-
Notifications
You must be signed in to change notification settings - Fork 308
/
fixtures.ts
41 lines (40 loc) · 994 Bytes
/
fixtures.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import nock from 'nock'
export const mockResponseSuccess = (): nock.Scope =>
nock('https://app.pinkswantrading.com', {
encodedQueryParams: true,
reqheaders: {
'x-oracle': 'fake-api-key',
},
})
.get('/graphql', {
query:
'query ChainlinkIv($symbol: SymbolEnumType){ChainlinkIv(symbol: $symbol){oneDayIv twoDayIv sevenDayIv fourteenDayIv twentyOneDayIv twentyEightDayIv}}',
variables: { symbol: 'ETH' },
})
.reply(
200,
() => ({
data: {
ChainlinkIv: [
{
oneDayIv: 89.31,
twoDayIv: 88.3,
sevenDayIv: 90.26,
fourteenDayIv: 92.54,
twentyOneDayIv: 97.43,
twentyEightDayIv: 99.82,
},
],
},
}),
[
'Content-Type',
'application/json',
'Connection',
'close',
'Vary',
'Accept-Encoding',
'Vary',
'Origin',
],
)