mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-09 13:26:10 +00:00
6e9635c12b
* 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
31 lines
773 B
JavaScript
31 lines
773 B
JavaScript
/*global contract, config, it*/
|
|
const assert = require('assert');
|
|
const SimpleStorage = require('Embark/contracts/SimpleStorage');
|
|
|
|
config({
|
|
contracts: {
|
|
deploy: {
|
|
"SimpleStorage": {
|
|
args: [100]
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
contract("SimpleStorage", function () {
|
|
this.timeout(0);
|
|
|
|
it("should set constructor value", async function () {
|
|
let result = await SimpleStorage.methods.storedData().call();
|
|
assert.strictEqual(parseInt(result, 10), 100);
|
|
});
|
|
|
|
it("set storage value", async function () {
|
|
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);
|
|
});
|
|
});
|