mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-24 20:51:55 +00:00
7e00786ee8
Also, in `dapps/tests/contracts` move the `this.timeout(0);` inside the `it(...)` for the expensive gas esimation (involving `SimpleStorage.methods.set`) because it otherwise doesn't seem to have an effect on the default 15 second timeout.
30 lines
774 B
JavaScript
30 lines
774 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 () {
|
|
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 () {
|
|
this.timeout(0);
|
|
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);
|
|
});
|
|
});
|