From 79ebb6a1c3594a92b04e234dd03a96f5ed70246e Mon Sep 17 00:00:00 2001 From: Gadi Cohen Date: Wed, 23 Feb 2022 17:26:32 +0200 Subject: [PATCH] chore(tests): re-enable chart empty arrays test + coverage --- src/modules/chart.spec.ts | 13 +++++++------ ...-2021-11-23-to-2021-11-23-interval-1h.fake.json} | 0 2 files changed, 7 insertions(+), 6 deletions(-) rename tests/http/{chart-TSLA-2021-11-23-to-2021-11-23-interval-1h.json => chart-TSLA-2021-11-23-to-2021-11-23-interval-1h.fake.json} (100%) diff --git a/src/modules/chart.spec.ts b/src/modules/chart.spec.ts index 7ac52167..24713baa 100644 --- a/src/modules/chart.spec.ts +++ b/src/modules/chart.spec.ts @@ -41,8 +41,6 @@ describe("chart", () => { }); describe("specific cases", () => { - /* - This test is now irrelevant since we no longer allow period1===period2 it("optional fields, empty arrays", async () => { /* * Same day period with 1h interval, this result has these aspects: @@ -50,14 +48,17 @@ describe("chart", () => { * - Missing fields: timestamp (because no quotes) * - New fields: previousClose, scale, tradingPeriods * - Pecularity: indicators.quote is [{}], indicators.adjclose missing - */ /* + */ await yf.chart( "TSLA", - { period1: "2021-11-23", period2: "2021-11-23", interval: "1h" }, - { devel: "chart-TSLA-2021-11-23-to-2021-11-23-interval-1h.json" } + // This is a .fake.json test not because we've modified the result, + // but because chart() no longer allows period1===period2 (because + // it leads to these kind of results). Nevertheless, let's be prepared. + // So the .fake.json result is from query period1=period2="2021-11-23". + { period1: "2021-11-23", period2: "2021-11-24", interval: "1h" }, + { devel: "chart-TSLA-2021-11-23-to-2021-11-23-interval-1h.fake.json" } ); }); - */ it("handles queries with tradingPeriod.regular", async () => { // Had tradingPeriod.regular, probably a timezone thing diff --git a/tests/http/chart-TSLA-2021-11-23-to-2021-11-23-interval-1h.json b/tests/http/chart-TSLA-2021-11-23-to-2021-11-23-interval-1h.fake.json similarity index 100% rename from tests/http/chart-TSLA-2021-11-23-to-2021-11-23-interval-1h.json rename to tests/http/chart-TSLA-2021-11-23-to-2021-11-23-interval-1h.fake.json