1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

moved before into describe to enable running of single unit tests

This commit is contained in:
Sebastian Gerske 2018-10-19 12:27:46 +02:00
parent 61d4f9f64d
commit d777bd9030
7 changed files with 60 additions and 60 deletions

View File

@ -5,14 +5,14 @@ import ContractBaseMock from "../mocks/ContractBase.Mock"
const wrappedContract = new ContractBaseMock("OceanToken")
describe("ContractBase", () => {
before(async () => {
ConfigProvider.configure(config)
await ContractHandler.deployContracts()
wrappedContract.initMock()
})
describe("ContractWrapperBase", () => {
describe("#call()", () => {
it("should fail to call on an unknown contract function", (done) => {

View File

@ -3,13 +3,13 @@ import ConfigProvider from "../../src/ConfigProvider"
import ContractHandler from "../../src/keeper/ContractHandler"
import config from "../config"
describe("ContractHandler", () => {
before(async () => {
ConfigProvider.configure(config)
await ContractHandler.deployContracts()
})
describe("ContractHandler", () => {
describe("#get()", () => {
it("should load and get OceanToken correctly", async () => {

View File

@ -6,14 +6,14 @@ import config from "../config"
let keeper: Keeper
describe("Keeper", () => {
before(async () => {
ConfigProvider.configure(config)
await ContractHandler.deployContracts()
keeper = await Keeper.getInstance()
})
describe("Keeper", () => {
describe("public interface", () => {
it("should have market", () => {

View File

@ -9,6 +9,8 @@ import config from "../config"
let ocean: Ocean
let accounts: Account[]
describe("Account", () => {
before(async () => {
ConfigProvider.configure(config)
await ContractHandler.deployContracts()
@ -17,8 +19,6 @@ before(async () => {
accounts = await ocean.getAccounts()
})
describe("Account", () => {
describe("#getOceanBalance()", () => {
it("should get initial ocean balance", async () => {

View File

@ -19,6 +19,8 @@ let testAsset: Asset
let accounts: Account[]
let testPublisher: Account
describe("Asset", () => {
before(async () => {
ConfigProvider.configure(config)
ProviderProvider.setProvider(ProviderMock)
@ -32,8 +34,6 @@ before(async () => {
await ocean.register(testAsset)
})
describe("Asset", () => {
describe("#purchase()", () => {
it("should purchase an asset", async () => {

View File

@ -17,6 +17,8 @@ const description = "This asset is pure owange"
const price = 100
const timeout = 100000000
describe("Ocean", () => {
before(async () => {
ConfigProvider.configure(config)
await ContractHandler.deployContracts()
@ -27,8 +29,6 @@ before(async () => {
testAsset = new Asset(name, description, price, testPublisher)
})
describe("Ocean", () => {
describe("#getInstance()", () => {
it("should list accounts", async () => {

View File

@ -20,6 +20,8 @@ let accounts: Account[]
let testPublisher: Account
let testConsumer: Account
describe("Order", () => {
before(async () => {
ConfigProvider.configure(config)
await ContractHandler.deployContracts()
@ -32,8 +34,6 @@ before(async () => {
await ocean.register(testAsset)
})
describe("Order", () => {
describe("#pay()", async () => {
it("should pay for an order", async () => {