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,13 +5,13 @@ import ContractBaseMock from "../mocks/ContractBase.Mock"
|
||||
|
||||
const wrappedContract = new ContractBaseMock("OceanToken")
|
||||
|
||||
before(async () => {
|
||||
describe("ContractBase", () => {
|
||||
|
||||
before(async () => {
|
||||
ConfigProvider.configure(config)
|
||||
await ContractHandler.deployContracts()
|
||||
wrappedContract.initMock()
|
||||
})
|
||||
|
||||
describe("ContractWrapperBase", () => {
|
||||
})
|
||||
|
||||
describe("#call()", () => {
|
||||
|
||||
|
@ -3,12 +3,12 @@ import ConfigProvider from "../../src/ConfigProvider"
|
||||
import ContractHandler from "../../src/keeper/ContractHandler"
|
||||
import config from "../config"
|
||||
|
||||
before(async () => {
|
||||
describe("ContractHandler", () => {
|
||||
|
||||
before(async () => {
|
||||
ConfigProvider.configure(config)
|
||||
await ContractHandler.deployContracts()
|
||||
})
|
||||
|
||||
describe("ContractHandler", () => {
|
||||
})
|
||||
|
||||
describe("#get()", () => {
|
||||
|
||||
|
@ -6,13 +6,13 @@ import config from "../config"
|
||||
|
||||
let keeper: Keeper
|
||||
|
||||
before(async () => {
|
||||
describe("Keeper", () => {
|
||||
|
||||
before(async () => {
|
||||
ConfigProvider.configure(config)
|
||||
await ContractHandler.deployContracts()
|
||||
keeper = await Keeper.getInstance()
|
||||
})
|
||||
|
||||
describe("Keeper", () => {
|
||||
})
|
||||
|
||||
describe("public interface", () => {
|
||||
|
||||
|
@ -9,15 +9,15 @@ import config from "../config"
|
||||
let ocean: Ocean
|
||||
let accounts: Account[]
|
||||
|
||||
before(async () => {
|
||||
describe("Account", () => {
|
||||
|
||||
before(async () => {
|
||||
ConfigProvider.configure(config)
|
||||
await ContractHandler.deployContracts()
|
||||
ocean = await Ocean.getInstance(config)
|
||||
|
||||
accounts = await ocean.getAccounts()
|
||||
})
|
||||
|
||||
describe("Account", () => {
|
||||
})
|
||||
|
||||
describe("#getOceanBalance()", () => {
|
||||
|
||||
|
@ -19,7 +19,9 @@ let testAsset: Asset
|
||||
let accounts: Account[]
|
||||
let testPublisher: Account
|
||||
|
||||
before(async () => {
|
||||
describe("Asset", () => {
|
||||
|
||||
before(async () => {
|
||||
ConfigProvider.configure(config)
|
||||
ProviderProvider.setProvider(ProviderMock)
|
||||
|
||||
@ -30,9 +32,7 @@ before(async () => {
|
||||
testAsset = new Asset(testName, testDescription, testPrice, testPublisher)
|
||||
|
||||
await ocean.register(testAsset)
|
||||
})
|
||||
|
||||
describe("Asset", () => {
|
||||
})
|
||||
|
||||
describe("#purchase()", () => {
|
||||
|
||||
|
@ -17,7 +17,9 @@ const description = "This asset is pure owange"
|
||||
const price = 100
|
||||
const timeout = 100000000
|
||||
|
||||
before(async () => {
|
||||
describe("Ocean", () => {
|
||||
|
||||
before(async () => {
|
||||
ConfigProvider.configure(config)
|
||||
await ContractHandler.deployContracts()
|
||||
ocean = await Ocean.getInstance(config)
|
||||
@ -25,9 +27,7 @@ before(async () => {
|
||||
|
||||
testPublisher = accounts[0]
|
||||
testAsset = new Asset(name, description, price, testPublisher)
|
||||
})
|
||||
|
||||
describe("Ocean", () => {
|
||||
})
|
||||
|
||||
describe("#getInstance()", () => {
|
||||
|
||||
|
@ -20,7 +20,9 @@ let accounts: Account[]
|
||||
let testPublisher: Account
|
||||
let testConsumer: Account
|
||||
|
||||
before(async () => {
|
||||
describe("Order", () => {
|
||||
|
||||
before(async () => {
|
||||
ConfigProvider.configure(config)
|
||||
await ContractHandler.deployContracts()
|
||||
ocean = await Ocean.getInstance(config)
|
||||
@ -30,9 +32,7 @@ before(async () => {
|
||||
// register an asset to play around with
|
||||
testAsset = new Asset(testName, testDescription, testPrice, testPublisher)
|
||||
await ocean.register(testAsset)
|
||||
})
|
||||
|
||||
describe("Order", () => {
|
||||
})
|
||||
|
||||
describe("#pay()", async () => {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user