1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00
squid-js/test/keeper/ContractHandler.test.ts
2019-03-25 15:21:23 +01:00

30 lines
812 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).instanceConfig
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()
})
})
})
})