mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
27 lines
774 B
TypeScript
27 lines
774 B
TypeScript
import { assert } from 'chai'
|
|
import ContractHandler from '../../src/keeper/ContractHandler'
|
|
import { Ocean } from '../../src/ocean/Ocean'
|
|
import config from '../config'
|
|
|
|
describe('ContractHandler', () => {
|
|
let contractHandler: ContractHandler
|
|
|
|
before(async () => {
|
|
const { instanceConfig } = (await Ocean.getInstance(config)) as any
|
|
|
|
contractHandler = new ContractHandler(instanceConfig)
|
|
})
|
|
|
|
describe('#get()', () => {
|
|
it('should load and get OceanToken correctly', async () => {
|
|
assert(await contractHandler.get('OceanToken'))
|
|
})
|
|
|
|
it('should fail to load an unknown contract', done => {
|
|
contractHandler.get('OceanXXX').catch(() => {
|
|
done()
|
|
})
|
|
})
|
|
})
|
|
})
|