Skip to content

Commit ebc6a8e

Browse files
committed
chore(tests): commit missing http fixtures
1 parent 8dfe390 commit ebc6a8e

File tree

2 files changed

+190
-0
lines changed

2 files changed

+190
-0
lines changed

Diff for: tests/fixtures/http/chart-AAPL.json

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"request": {
3+
"url": "https://query2.finance.yahoo.com/v8/finance/chart/AAPL?useYfid=true&interval=1d&includePrePost=true&events=div%7Csplit%7Cearn&lang=en-US&period1=1645488000&period2=1645574400",
4+
"method": "GET",
5+
"headers": {
6+
"cookie": "",
7+
"user-agent": "@gadicc/yahoo-finance2/0.0.1 (+https://github.com/gadicc/node-yahoo-finance2)"
8+
}
9+
},
10+
"response": {
11+
"ok": true,
12+
"status": 200,
13+
"statusText": "OK",
14+
"headers": {
15+
"age": "1",
16+
"cache-control": "public, max-age=10, stale-while-revalidate=20",
17+
"content-length": "1190",
18+
"content-type": "application/json;charset=utf-8",
19+
"date": "Mon, 24 Mar 2025 13:51:33 GMT",
20+
"referrer-policy": "no-referrer-when-downgrade",
21+
"server": "ATS",
22+
"strict-transport-security": "max-age=31536000",
23+
"vary": "Origin,Accept-Encoding",
24+
"x-content-type-options": "nosniff",
25+
"x-envoy-decorator-operation": "finance-chart-api--mtls-production-ir2.finance-k8s:4080/*",
26+
"x-envoy-upstream-service-time": "42",
27+
"x-frame-options": "SAMEORIGIN",
28+
"x-xss-protection": "1; mode=block",
29+
"y-rid": "1pdbsq1ju2or6"
30+
},
31+
"bodyJson": {
32+
"chart": {
33+
"result": [
34+
{
35+
"meta": {
36+
"currency": "USD",
37+
"symbol": "AAPL",
38+
"exchangeName": "NMS",
39+
"fullExchangeName": "NasdaqGS",
40+
"instrumentType": "EQUITY",
41+
"firstTradeDate": 345479400,
42+
"regularMarketTime": 1742824293,
43+
"hasPrePostMarketData": true,
44+
"gmtoffset": -14400,
45+
"timezone": "EDT",
46+
"exchangeTimezoneName": "America/New_York",
47+
"regularMarketPrice": 220.003,
48+
"fiftyTwoWeekHigh": 260.1,
49+
"fiftyTwoWeekLow": 164.08,
50+
"regularMarketDayHigh": 221.021,
51+
"regularMarketDayLow": 218.58,
52+
"regularMarketVolume": 5800260,
53+
"longName": "Apple Inc.",
54+
"shortName": "Apple Inc.",
55+
"chartPreviousClose": 167.3,
56+
"priceHint": 2,
57+
"currentTradingPeriod": {
58+
"pre": {
59+
"timezone": "EDT",
60+
"start": 1742803200,
61+
"end": 1742823000,
62+
"gmtoffset": -14400
63+
},
64+
"regular": {
65+
"timezone": "EDT",
66+
"start": 1742823000,
67+
"end": 1742846400,
68+
"gmtoffset": -14400
69+
},
70+
"post": {
71+
"timezone": "EDT",
72+
"start": 1742846400,
73+
"end": 1742860800,
74+
"gmtoffset": -14400
75+
}
76+
},
77+
"dataGranularity": "1d",
78+
"range": "",
79+
"validRanges": [
80+
"1d",
81+
"5d",
82+
"1mo",
83+
"3mo",
84+
"6mo",
85+
"1y",
86+
"2y",
87+
"5y",
88+
"10y",
89+
"ytd",
90+
"max"
91+
]
92+
},
93+
"timestamp": [
94+
1645540200
95+
],
96+
"indicators": {
97+
"quote": [
98+
{
99+
"high": [
100+
166.69000244140625
101+
],
102+
"volume": [
103+
91162800
104+
],
105+
"low": [
106+
162.14999389648438
107+
],
108+
"open": [
109+
164.97999572753906
110+
],
111+
"close": [
112+
164.32000732421875
113+
]
114+
}
115+
],
116+
"adjclose": [
117+
{
118+
"adjclose": [
119+
161.6998748779297
120+
]
121+
}
122+
]
123+
}
124+
}
125+
],
126+
"error": null
127+
}
128+
}
129+
}
130+
}

Diff for: tests/fixtures/http/search-badResult.fake.json

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"request": {
3+
"url": "https://query2.finance.yahoo.com/v1/finance/search?lang=en-US&region=US&quotesCount=6&newsCount=4&enableFuzzyQuery=false&quotesQueryId=tss_match_phrase_query&multiQuoteQueryId=multi_quote_single_token_query&newsQueryId=news_cie_vespa&enableCb=true&enableNavLinks=true&enableEnhancedTrivialQuery=true&q=AAPL",
4+
"method": "GET",
5+
"headers": {
6+
"cookie": "",
7+
"user-agent": "@gadicc/yahoo-finance2/0.0.1 (+https://github.com/gadicc/node-yahoo-finance2)"
8+
}
9+
},
10+
"response": {
11+
"ok": true,
12+
"status": 200,
13+
"statusText": "OK",
14+
"headers": {
15+
"age": "1",
16+
"cache-control": "public, max-age=600, stale-while-revalidate=180",
17+
"content-type": "application/json;charset=utf-8",
18+
"date": "Mon, 24 Mar 2025 13:51:33 GMT",
19+
"referrer-policy": "no-referrer-when-downgrade",
20+
"server": "ATS",
21+
"strict-transport-security": "max-age=31536000",
22+
"vary": "Origin,Origin,Accept-Encoding",
23+
"x-content-type-options": "nosniff",
24+
"x-envoy-decorator-operation": "finance-search--mtls-production-ir2.finance-k8s:4080/*",
25+
"x-envoy-upstream-service-time": "98",
26+
"x-frame-options": "SAMEORIGIN",
27+
"x-xss-protection": "1; mode=block",
28+
"y-rid": "7tc4pn9ju2or6"
29+
},
30+
"bodyJson": {
31+
"explains": "shouldBeArray",
32+
"count": "shouldbeInt",
33+
"quotes": [
34+
{
35+
"shouldNot": "exist"
36+
}
37+
],
38+
"news": [
39+
{
40+
"shouldNot": "exist"
41+
}
42+
],
43+
"nav": [],
44+
"lists": [],
45+
"researchReports": [],
46+
"screenerFieldResults": [],
47+
"totalTime": 95,
48+
"timeTakenForQuotes": 440,
49+
"timeTakenForNews": 700,
50+
"timeTakenForAlgowatchlist": 400,
51+
"timeTakenForPredefinedScreener": 400,
52+
"timeTakenForCrunchbase": 400,
53+
"timeTakenForNav": 400,
54+
"timeTakenForResearchReports": 0,
55+
"timeTakenForScreenerField": 0,
56+
"timeTakenForCulturalAssets": 0,
57+
"timeTakenForSearchLists": 0
58+
}
59+
}
60+
}

0 commit comments

Comments
 (0)