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:
parent
61d4f9f64d
commit
d777bd9030
@ -5,14 +5,14 @@ import ContractBaseMock from "../mocks/ContractBase.Mock"
|
|||||||
|
|
||||||
const wrappedContract = new ContractBaseMock("OceanToken")
|
const wrappedContract = new ContractBaseMock("OceanToken")
|
||||||
|
|
||||||
|
describe("ContractBase", () => {
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
ConfigProvider.configure(config)
|
ConfigProvider.configure(config)
|
||||||
await ContractHandler.deployContracts()
|
await ContractHandler.deployContracts()
|
||||||
wrappedContract.initMock()
|
wrappedContract.initMock()
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("ContractWrapperBase", () => {
|
|
||||||
|
|
||||||
describe("#call()", () => {
|
describe("#call()", () => {
|
||||||
|
|
||||||
it("should fail to call on an unknown contract function", (done) => {
|
it("should fail to call on an unknown contract function", (done) => {
|
||||||
|
@ -3,13 +3,13 @@ import ConfigProvider from "../../src/ConfigProvider"
|
|||||||
import ContractHandler from "../../src/keeper/ContractHandler"
|
import ContractHandler from "../../src/keeper/ContractHandler"
|
||||||
import config from "../config"
|
import config from "../config"
|
||||||
|
|
||||||
|
describe("ContractHandler", () => {
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
ConfigProvider.configure(config)
|
ConfigProvider.configure(config)
|
||||||
await ContractHandler.deployContracts()
|
await ContractHandler.deployContracts()
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("ContractHandler", () => {
|
|
||||||
|
|
||||||
describe("#get()", () => {
|
describe("#get()", () => {
|
||||||
|
|
||||||
it("should load and get OceanToken correctly", async () => {
|
it("should load and get OceanToken correctly", async () => {
|
||||||
|
@ -6,14 +6,14 @@ import config from "../config"
|
|||||||
|
|
||||||
let keeper: Keeper
|
let keeper: Keeper
|
||||||
|
|
||||||
|
describe("Keeper", () => {
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
ConfigProvider.configure(config)
|
ConfigProvider.configure(config)
|
||||||
await ContractHandler.deployContracts()
|
await ContractHandler.deployContracts()
|
||||||
keeper = await Keeper.getInstance()
|
keeper = await Keeper.getInstance()
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("Keeper", () => {
|
|
||||||
|
|
||||||
describe("public interface", () => {
|
describe("public interface", () => {
|
||||||
|
|
||||||
it("should have market", () => {
|
it("should have market", () => {
|
||||||
|
@ -9,6 +9,8 @@ import config from "../config"
|
|||||||
let ocean: Ocean
|
let ocean: Ocean
|
||||||
let accounts: Account[]
|
let accounts: Account[]
|
||||||
|
|
||||||
|
describe("Account", () => {
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
ConfigProvider.configure(config)
|
ConfigProvider.configure(config)
|
||||||
await ContractHandler.deployContracts()
|
await ContractHandler.deployContracts()
|
||||||
@ -17,8 +19,6 @@ before(async () => {
|
|||||||
accounts = await ocean.getAccounts()
|
accounts = await ocean.getAccounts()
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("Account", () => {
|
|
||||||
|
|
||||||
describe("#getOceanBalance()", () => {
|
describe("#getOceanBalance()", () => {
|
||||||
|
|
||||||
it("should get initial ocean balance", async () => {
|
it("should get initial ocean balance", async () => {
|
||||||
|
@ -19,6 +19,8 @@ let testAsset: Asset
|
|||||||
let accounts: Account[]
|
let accounts: Account[]
|
||||||
let testPublisher: Account
|
let testPublisher: Account
|
||||||
|
|
||||||
|
describe("Asset", () => {
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
ConfigProvider.configure(config)
|
ConfigProvider.configure(config)
|
||||||
ProviderProvider.setProvider(ProviderMock)
|
ProviderProvider.setProvider(ProviderMock)
|
||||||
@ -32,8 +34,6 @@ before(async () => {
|
|||||||
await ocean.register(testAsset)
|
await ocean.register(testAsset)
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("Asset", () => {
|
|
||||||
|
|
||||||
describe("#purchase()", () => {
|
describe("#purchase()", () => {
|
||||||
|
|
||||||
it("should purchase an asset", async () => {
|
it("should purchase an asset", async () => {
|
||||||
|
@ -17,6 +17,8 @@ const description = "This asset is pure owange"
|
|||||||
const price = 100
|
const price = 100
|
||||||
const timeout = 100000000
|
const timeout = 100000000
|
||||||
|
|
||||||
|
describe("Ocean", () => {
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
ConfigProvider.configure(config)
|
ConfigProvider.configure(config)
|
||||||
await ContractHandler.deployContracts()
|
await ContractHandler.deployContracts()
|
||||||
@ -27,8 +29,6 @@ before(async () => {
|
|||||||
testAsset = new Asset(name, description, price, testPublisher)
|
testAsset = new Asset(name, description, price, testPublisher)
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("Ocean", () => {
|
|
||||||
|
|
||||||
describe("#getInstance()", () => {
|
describe("#getInstance()", () => {
|
||||||
|
|
||||||
it("should list accounts", async () => {
|
it("should list accounts", async () => {
|
||||||
|
@ -20,6 +20,8 @@ let accounts: Account[]
|
|||||||
let testPublisher: Account
|
let testPublisher: Account
|
||||||
let testConsumer: Account
|
let testConsumer: Account
|
||||||
|
|
||||||
|
describe("Order", () => {
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
ConfigProvider.configure(config)
|
ConfigProvider.configure(config)
|
||||||
await ContractHandler.deployContracts()
|
await ContractHandler.deployContracts()
|
||||||
@ -32,8 +34,6 @@ before(async () => {
|
|||||||
await ocean.register(testAsset)
|
await ocean.register(testAsset)
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("Order", () => {
|
|
||||||
|
|
||||||
describe("#pay()", async () => {
|
describe("#pay()", async () => {
|
||||||
|
|
||||||
it("should pay for an order", async () => {
|
it("should pay for an order", async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user