embark/test_apps/test_app/test/simple_storage_spec.js

32 lines
686 B
JavaScript
Raw Normal View History

2018-01-15 09:51:45 -05:00
2018-01-05 15:10:47 -05:00
contract("SimpleStorage", function() {
2018-01-15 09:51:45 -05:00
2018-01-05 15:10:47 -05:00
this.timeout(0);
2017-02-09 19:38:02 -05:00
before(function(done) {
this.timeout(0);
2018-01-15 09:51:45 -05:00
//config({
// node: "http://localhost:8545"
//});
2018-01-15 09:51:45 -05:00
2017-02-09 19:38:02 -05:00
var contractsConfig = {
"SimpleStorage": {
args: [100]
}
};
2017-12-22 13:07:43 -05:00
EmbarkSpec.deployAll(contractsConfig, () => { done() });
2017-02-09 19:38:02 -05:00
});
2018-04-17 14:48:31 -04:00
it("should set constructor value", async function() {
let result = await SimpleStorage.methods.storedData().call();
assert.equal(result, 100);
2017-02-09 19:38:02 -05:00
});
2018-04-17 14:48:31 -04:00
it("set storage value", async function() {
await SimpleStorage.methods.set(150).send();
let result = await SimpleStorage.methods.get().call();
assert.equal(result, 499650);
2017-02-09 19:38:02 -05:00
});
});