-
Notifications
You must be signed in to change notification settings - Fork 316
/
Copy pathelection.test.ts
36 lines (33 loc) · 966 Bytes
/
election.test.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
import { assertSuccess } from '@chainlink/ea-test-helpers'
import { AdapterRequest } from '@chainlink/ea-bootstrap'
import { makeExecute } from '../../src/adapter'
import { TInputParameters } from '../../src/endpoint'
describe('execute', () => {
const jobID = '1'
const execute = makeExecute()
describe('successful requests', () => {
const requests = [
{
name: 'empty body',
testData: {
id: jobID,
data: {
date: '2021-06-08',
statePostal: 'VA',
officeID: 'A',
raceID: '',
raceType: 'D',
level: 'state',
resultsType: '',
},
},
},
]
requests.forEach((req) => {
it(`${req.name}`, async () => {
const adapterResponse = await execute(req.testData as AdapterRequest<TInputParameters>, {})
assertSuccess(adapterResponse.statusCode, adapterResponse, jobID)
})
})
})
})