-
Notifications
You must be signed in to change notification settings - Fork 316
/
Copy pathconfig.test.ts
34 lines (29 loc) · 1.06 KB
/
config.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
import { setEnvVariables } from '@chainlink/ea-test-helpers'
import * as adapter from '../../src'
describe('config', () => {
let oldEnv: NodeJS.ProcessEnv
beforeEach(() => {
oldEnv = JSON.parse(JSON.stringify(process.env))
})
afterEach(() => {
setEnvVariables(oldEnv)
})
it('has expected root exports', () => {
expect(adapter).toHaveProperty('NAME')
expect(typeof adapter.NAME).toBe('string')
expect(adapter.NAME).toBe('SWELL_ADDRESS_LIST')
expect(adapter).toHaveProperty('makeExecute')
expect(typeof adapter.makeExecute).toBe('function')
expect(adapter).toHaveProperty('makeConfig')
expect(typeof adapter.makeConfig).toBe('function')
expect(adapter).toHaveProperty('server')
expect(typeof adapter.server).toBe('function')
expect(adapter).toHaveProperty('endpoints')
expect(typeof adapter.endpoints).toBe('object')
})
it('builds the correct config', () => {
process.env.RPC_URL = 'http://localhost:8545'
const config = adapter.makeConfig()
expect(config.rpcUrl).toEqual(process.env.RPC_URL)
})
})