2018-10-18 09:19:10 +02:00
|
|
|
import {assert} from "chai"
|
2018-10-16 14:56:18 +02:00
|
|
|
import ConfigProvider from "../../src/ConfigProvider"
|
2018-10-05 12:34:18 +02:00
|
|
|
import ContractHandler from "../../src/keeper/ContractHandler"
|
|
|
|
import Keeper from "../../src/keeper/Keeper"
|
2018-10-16 14:56:18 +02:00
|
|
|
import config from "../config"
|
2018-10-05 12:34:18 +02:00
|
|
|
|
|
|
|
let keeper: Keeper
|
|
|
|
|
|
|
|
before(async () => {
|
2018-10-16 14:56:18 +02:00
|
|
|
ConfigProvider.configure(config)
|
|
|
|
await ContractHandler.deployContracts()
|
|
|
|
keeper = await Keeper.getInstance()
|
2018-10-05 12:34:18 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
describe("Keeper", () => {
|
|
|
|
|
|
|
|
describe("public interface", () => {
|
|
|
|
|
|
|
|
it("should have market", () => {
|
|
|
|
assert(keeper.market !== null)
|
|
|
|
})
|
|
|
|
|
|
|
|
it("should have auth", () => {
|
|
|
|
assert(keeper.auth !== null)
|
|
|
|
})
|
|
|
|
|
|
|
|
it("should have token", () => {
|
|
|
|
assert(keeper.token !== null)
|
|
|
|
})
|
2018-10-16 14:56:18 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
describe("#getNetworkName()", () => {
|
2018-10-05 12:34:18 +02:00
|
|
|
|
2018-10-16 14:56:18 +02:00
|
|
|
it("should get development as default", async () => {
|
|
|
|
const networkName: string = await keeper.getNetworkName()
|
|
|
|
assert(networkName === "development")
|
2018-10-05 12:34:18 +02:00
|
|
|
})
|
2018-10-16 14:56:18 +02:00
|
|
|
|
2018-10-05 12:34:18 +02:00
|
|
|
})
|
|
|
|
})
|