From 07449ed18d82a035ee827439a060fd2a55068967 Mon Sep 17 00:00:00 2001 From: Ahmed Ali Date: Fri, 19 Jun 2020 15:34:45 +0200 Subject: [PATCH] fix tests --- package.json | 2 +- test/integration/Simpleflow.test.ts | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index aa932f1d..7d81dc0d 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "changelog": "auto-changelog -p", "prepublishOnly": "npm run build", "test:unit": "mocha --config=test/unit/.mocharc.json --node-env=test --exit test/unit/**/*.ts", - "test:integration": "mocha --opts test/integration/mocha.opts" + "test:integration": "mocha --config=test/integration/.mocharc.json --node-env=test --exit test/integration/**/*.ts" }, "repository": { "type": "git", diff --git a/test/integration/Simpleflow.test.ts b/test/integration/Simpleflow.test.ts index 92e3ab43..6ce2313d 100644 --- a/test/integration/Simpleflow.test.ts +++ b/test/integration/Simpleflow.test.ts @@ -6,9 +6,8 @@ import { Config } from '../../src/models/Config' const Web3 = require('web3') const web3 = new Web3('http://127.0.0.1:8545') - -const factoryABI = require('../../src/datatokens/FactoryABI.json') -const datatokensABI = require('../../src/datatokens/DatatokensABI.json') +const factory = require('@oceanprotocol/contracts/artifacts/development/Factory.json') +const datatokensTemplate = require('@oceanprotocol/contracts/artifacts/development/DataTokenTemplate.json') describe('Simple flow', () => { let owner @@ -26,7 +25,12 @@ describe('Simple flow', () => { describe('#test', () => { it('Initialize Ocean contracts v3', async () => { - contracts = new TestContractHandler(factoryABI, datatokensABI) + contracts = new TestContractHandler( + factory.abi, + datatokensTemplate.abi, + datatokensTemplate.bytecode, + factory.bytecode + ) await contracts.getAccounts() owner = contracts.accounts[0] alice = contracts.accounts[1] @@ -38,8 +42,8 @@ describe('Simple flow', () => { // Alice creates a Datatoken datatoken = new DataTokens( contracts.factoryAddress, - factoryABI, - datatokensABI, + factory.abi, + datatokensTemplate.abi, web3 ) tokenAddress = await datatoken.create(blob, alice)