embark/test_apps/contracts_app/test/simple_storage_spec.js

32 lines
686 B
JavaScript

contract("SimpleStorage", function() {
this.timeout(0);
before(function(done) {
this.timeout(0);
//config({
// node: "http://localhost:8545"
//});
var contractsConfig = {
"SimpleStorage": {
args: [100]
}
};
EmbarkSpec.deployAll(contractsConfig, () => { done() });
});
it("should set constructor value", async function() {
let result = await SimpleStorage.methods.storedData().call();
assert.equal(result, 100);
});
it("set storage value", async function() {
await SimpleStorage.methods.set(150).send();
let result = await SimpleStorage.methods.get().call();
assert.equal(result, 499650);
});
});