-
Notifications
You must be signed in to change notification settings - Fork 260
Expand file tree
/
Copy pathadapter.test.ts
More file actions
34 lines (31 loc) · 1.04 KB
/
adapter.test.ts
File metadata and controls
34 lines (31 loc) · 1.04 KB
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
import { AdapterError, Requester } from '@chainlink/ea-bootstrap'
import { assertError } from '@chainlink/ea-test-helpers'
import type { AdapterRequest } from '@chainlink/ea-bootstrap'
import { makeExecute } from '../../src/endpoint'
import { makeConfig } from '../../src/config'
describe('execute', () => {
const jobID = '1'
process.env.DATA_PROVIDER_URL = 'ignoreable'
const execute = makeExecute(makeConfig(''))
describe('error calls @integration', () => {
const requests = [
{
name: 'invalid units',
testData: {
id: jobID,
data: { allocations: [{ symbol: 'DAI', balance: '1000000000000000000', decimals: 18 }] },
},
},
]
requests.forEach((req) => {
it(`${req.name}`, async () => {
try {
await execute(req.testData as AdapterRequest, {})
} catch (error) {
const errorResp = Requester.errored(jobID, error as AdapterError)
assertError({ expected: 500, actual: errorResp.statusCode }, errorResp, jobID)
}
})
})
})
})