embark/test_apps/test_app/test/simple_storage_spec.js

32 lines
686 B
JavaScript
Raw Normal View History

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