embark/dapps/tests/contracts/test/another_storage_spec.js
Jonathan Rainville 6e9635c12b fix(@contract-app): fix contracts app tests (#1982)
* refactor(@embark/dapps/tests/app): use function syntax

These changes don't fix the race conditions related to the test dapp's tests
but are a step in the right direction.

* refactor(@embark/dapps/tests/contracts): adjustments to get tests passing

Further refactoring is needed re: potentially duplicated or overlapping logic
in `packages/plugins/solidity-tests` and
`packages/core/utils/src/solidity/remapImports.ts`, as well in disabled test
dapp tests

* test(dapps/tests/app): temporarily disable intermittently failing tests

They are failing because of a race condition; once that race condition has been
fixed these tests should be reenabled.

* fix(@embark/solidity-tests): fix importing the library for the tests
2019-10-23 14:58:40 -04:00

42 lines
1.0 KiB
JavaScript

/*global contract, config, it*/
const assert = require('assert');
const AnotherStorage = require('Embark/contracts/AnotherStorage');
const SimpleStorage = require('Embark/contracts/SimpleStorage');
let accounts;
config({
namesystem: {
enabled: true
},
contracts: {
deploy: {
"SimpleStorage": {
args: [100]
},
// "AnotherStorage": {
// args: ["$SimpleStorage", "embark.eth"]
// },
"AnotherStorage": {
args: ["$SimpleStorage", "$SimpleStorage"]
}
}
}
}, (err, accs) => {
accounts = accs;
});
contract("AnotherStorage", function() {
this.timeout(0);
it("set SimpleStorage address", async function() {
const result = await AnotherStorage.methods.simpleStorageAddress().call();
assert.equal(result.toString(), SimpleStorage.options.address);
});
// 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]);
});
});