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,13 +5,13 @@ import ContractBaseMock from "../mocks/ContractBase.Mock"
const wrappedContract = new ContractBaseMock("OceanToken") const wrappedContract = new ContractBaseMock("OceanToken")
before(async () => { describe("ContractBase", () => {
before(async () => {
ConfigProvider.configure(config) ConfigProvider.configure(config)
await ContractHandler.deployContracts() await ContractHandler.deployContracts()
wrappedContract.initMock() wrappedContract.initMock()
}) })
describe("ContractWrapperBase", () => {
describe("#call()", () => { describe("#call()", () => {

View File

@ -3,12 +3,12 @@ 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"
before(async () => { describe("ContractHandler", () => {
before(async () => {
ConfigProvider.configure(config) ConfigProvider.configure(config)
await ContractHandler.deployContracts() await ContractHandler.deployContracts()
}) })
describe("ContractHandler", () => {
describe("#get()", () => { describe("#get()", () => {

View File

@ -6,13 +6,13 @@ import config from "../config"
let keeper: Keeper let keeper: Keeper
before(async () => { describe("Keeper", () => {
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", () => {

View File

@ -9,15 +9,15 @@ import config from "../config"
let ocean: Ocean let ocean: Ocean
let accounts: Account[] let accounts: Account[]
before(async () => { describe("Account", () => {
before(async () => {
ConfigProvider.configure(config) ConfigProvider.configure(config)
await ContractHandler.deployContracts() await ContractHandler.deployContracts()
ocean = await Ocean.getInstance(config) ocean = await Ocean.getInstance(config)
accounts = await ocean.getAccounts() accounts = await ocean.getAccounts()
}) })
describe("Account", () => {
describe("#getOceanBalance()", () => { describe("#getOceanBalance()", () => {

View File

@ -19,7 +19,9 @@ let testAsset: Asset
let accounts: Account[] let accounts: Account[]
let testPublisher: Account let testPublisher: Account
before(async () => { describe("Asset", () => {
before(async () => {
ConfigProvider.configure(config) ConfigProvider.configure(config)
ProviderProvider.setProvider(ProviderMock) ProviderProvider.setProvider(ProviderMock)
@ -30,9 +32,7 @@ before(async () => {
testAsset = new Asset(testName, testDescription, testPrice, testPublisher) testAsset = new Asset(testName, testDescription, testPrice, testPublisher)
await ocean.register(testAsset) await ocean.register(testAsset)
}) })
describe("Asset", () => {
describe("#purchase()", () => { describe("#purchase()", () => {

View File

@ -17,7 +17,9 @@ const description = "This asset is pure owange"
const price = 100 const price = 100
const timeout = 100000000 const timeout = 100000000
before(async () => { describe("Ocean", () => {
before(async () => {
ConfigProvider.configure(config) ConfigProvider.configure(config)
await ContractHandler.deployContracts() await ContractHandler.deployContracts()
ocean = await Ocean.getInstance(config) ocean = await Ocean.getInstance(config)
@ -25,9 +27,7 @@ before(async () => {
testPublisher = accounts[0] testPublisher = accounts[0]
testAsset = new Asset(name, description, price, testPublisher) testAsset = new Asset(name, description, price, testPublisher)
}) })
describe("Ocean", () => {
describe("#getInstance()", () => { describe("#getInstance()", () => {

View File

@ -20,7 +20,9 @@ let accounts: Account[]
let testPublisher: Account let testPublisher: Account
let testConsumer: Account let testConsumer: Account
before(async () => { describe("Order", () => {
before(async () => {
ConfigProvider.configure(config) ConfigProvider.configure(config)
await ContractHandler.deployContracts() await ContractHandler.deployContracts()
ocean = await Ocean.getInstance(config) ocean = await Ocean.getInstance(config)
@ -30,9 +32,7 @@ before(async () => {
// register an asset to play around with // register an asset to play around with
testAsset = new Asset(testName, testDescription, testPrice, testPublisher) testAsset = new Asset(testName, testDescription, testPrice, testPublisher)
await ocean.register(testAsset) await ocean.register(testAsset)
}) })
describe("Order", () => {
describe("#pay()", async () => { describe("#pay()", async () => {