diff --git a/dapps/tests/app/test/solidity_test.sol b/dapps/tests/app/test/solidity_test.sol index c68c73eda3..cfb6a4fed8 100644 --- a/dapps/tests/app/test/solidity_test.sol +++ b/dapps/tests/app/test/solidity_test.sol @@ -9,6 +9,6 @@ contract MyTest { } function valueShouldBe1() public { - Assert.equal(1, i, "value is not correct"); + require(1 == i, "value is not correct"); } } diff --git a/dapps/tests/contracts/test/another_storage_spec.js b/dapps/tests/contracts/test/another_storage_spec.js index de800ae66b..09359df49c 100644 --- a/dapps/tests/contracts/test/another_storage_spec.js +++ b/dapps/tests/contracts/test/another_storage_spec.js @@ -13,8 +13,11 @@ config({ "SimpleStorage": { args: [100] }, + // "AnotherStorage": { + // args: ["$SimpleStorage", "embark.eth"] + // }, "AnotherStorage": { - args: ["$SimpleStorage", "embark.eth"] + args: ["$SimpleStorage", "$SimpleStorage"] } } } @@ -30,7 +33,8 @@ contract("AnotherStorage", function() { assert.equal(result.toString(), SimpleStorage.options.address); }); - it("set ENS address", async function() { + // FIXME add back when the ENS feature is back + xit("set ENS address", async function() { const result = await AnotherStorage.methods.ens().call(); assert.equal(result.toString(), accounts[0]); }); diff --git a/dapps/tests/contracts/test/ownable_test.sol b/dapps/tests/contracts/test/ownable_test.sol index fb6ca4f1ef..c81535d3b2 100644 --- a/dapps/tests/contracts/test/ownable_test.sol +++ b/dapps/tests/contracts/test/ownable_test.sol @@ -12,6 +12,6 @@ contract OwnableTests { } function shouldnotbezeroAddress() public { - Assert.equal(true, true, "owner is uninitialized"); + require(true == true, "owner is uninitialized"); } } diff --git a/dapps/tests/contracts/test/simple_storage_spec.js b/dapps/tests/contracts/test/simple_storage_spec.js index aac5a48138..ebd9dbeff3 100644 --- a/dapps/tests/contracts/test/simple_storage_spec.js +++ b/dapps/tests/contracts/test/simple_storage_spec.js @@ -21,7 +21,9 @@ contract("SimpleStorage", function () { }); it("set storage value", async function () { - await SimpleStorage.methods.set(150).send(); + const toSend = SimpleStorage.methods.set(150); + const gas = await toSend.estimateGas(); + await toSend.send({gas}); let result = await SimpleStorage.methods.get().call(); assert.strictEqual(parseInt(result, 10), 499650); }); diff --git a/packages/plugins/solidity-tests/src/lib/index.js b/packages/plugins/solidity-tests/src/lib/index.js index d9687f252b..df9102140e 100644 --- a/packages/plugins/solidity-tests/src/lib/index.js +++ b/packages/plugins/solidity-tests/src/lib/index.js @@ -20,8 +20,8 @@ import "remix_tests.sol"; // ---------------------- `; const ASSERT_LIB = new File({ - path: "remix_tests.sol", - originalPath: dappPath("remix_tests.sol"), + path: dappPath(".embark", "remix_tests.sol"), + originalPath: dappPath(".embark", "remix_tests.sol"), type: Types.dappFile, resolver: (cb) => { cb(remixTests.assertLibCode); } }); @@ -84,7 +84,7 @@ class SolidityTestRunner { async.waterfall([ (next) => { // write the remix_tests file where it will be found. - fs.writeFile(dappPath('remix_tests.sol'), remixTests.assertLibCode, next); + fs.writeFile(ASSERT_LIB.originalPath, remixTests.assertLibCode, next); }, (next) => { events.request("contracts:reset", next); diff --git a/packages/stack/test-runner/src/lib/index.js b/packages/stack/test-runner/src/lib/index.js index e73ecf664a..d5930b0c12 100644 --- a/packages/stack/test-runner/src/lib/index.js +++ b/packages/stack/test-runner/src/lib/index.js @@ -53,7 +53,7 @@ class TestRunner { async.waterfall([ (next) => { - this.events.request("config:contractsConfig:set", Object.assign(this.configObj.contractsConfig, {explicit: true}), next); + this.events.request("config:contractsConfig:set", Object.assign(this.configObj.contractsConfig, {explicit: true, afterDeploy: null, beforeDeploy: null}), next); }, (next) => { this.getFilesFromDir(testPath, next);