-
Notifications
You must be signed in to change notification settings - Fork 308
/
Copy pathfixtures.ts
44 lines (43 loc) · 1.1 KB
/
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
42
43
44
import nock from 'nock'
export const mockResponseSuccess = (): nock.Scope =>
nock('http://127.0.0.1:1234', {
encodedQueryParams: true,
reqheaders: {
authorization: 'Bearer fake-api-key',
},
})
.persist()
.post('/rpc/v0', {
id: 1,
jsonrpc: '2.0',
method: 'Filecoin.WalletBalance',
params: ['f2eaaj6w4evrdscw4s4o5c3df7ph725tbs3yvg6gi'],
})
.reply(200, { jsonrpc: '2.0', result: '33426744125000000000000', id: 1 }, [
'Date',
'Wed, 22 Sep 2021 14:38:41 GMT',
'Content-Length',
'60',
'Content-Type',
'text/plain; charset=utf-8',
'Connection',
'close',
])
.persist()
.post('/rpc/v0', {
id: 2,
jsonrpc: '2.0',
method: 'Filecoin.WalletBalance',
params: ['f225ey7bq53ur6sgrkxgf74hl2ftxkajupatwnmay'],
})
.reply(200, { jsonrpc: '2.0', result: '850000000000000000', id: 2 }, [
'Date',
'Wed, 22 Sep 2021 14:38:42 GMT',
'Content-Length',
'55',
'Content-Type',
'text/plain; charset=utf-8',
'Connection',
'close',
])
.persist()