embark/dapps/templates/boilerplate/test/contract_spec.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

/*global contract, it*/
2018-09-01 14:34:12 +00:00
/*
const SimpleStorage = require('Embark/contracts/SimpleStorage');
2018-06-18 19:15:24 +00:00
2018-09-01 14:34:12 +00:00
let accounts;
// For documentation please see https://embark.status.im/docs/contracts_testing.html
2018-06-18 19:15:24 +00:00
config({
2018-09-01 14:34:12 +00:00
//deployment: {
// accounts: [
// // you can configure custom accounts with a custom balance
// // see https://embark.status.im/docs/contracts_testing.html#Configuring-accounts
// ]
//},
2018-06-18 19:15:24 +00:00
contracts: {
"SimpleStorage": {
args: [100]
}
}
2018-09-01 14:34:12 +00:00
}, (_err, web3_accounts) => {
accounts = web3_accounts
});*/
2018-06-18 19:15:24 +00:00
contract.skip("SimpleStorage", function () {
2018-06-18 19:15:24 +00:00
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 () {
await SimpleStorage.methods.set(150).send();
let result = await SimpleStorage.methods.get().call();
assert.strictEqual(parseInt(result, 10), 150);
});
2018-09-01 14:34:12 +00:00
it("should have account with balance", async function() {
let balance = await web3.eth.getBalance(accounts[0]);
assert.ok(parseInt(balance, 10) > 0);
});
});