/ test / contract_spec.js
contract_spec.js
 1  // /*global contract, config, it, assert*/
 2  /*
 3  const SimpleStorage = require('Embark/contracts/SimpleStorage');
 4  
 5  let accounts;
 6  
 7  // For documentation please see https://embark.status.im/docs/contracts_testing.html
 8  config({
 9    //deployment: {
10    //  accounts: [
11    //    // you can configure custom accounts with a custom balance
12    //    // see https://embark.status.im/docs/contracts_testing.html#Configuring-accounts
13    //  ]
14    //},
15    contracts: {
16      "SimpleStorage": {
17        args: [100]
18      }
19    }
20  }, (_err, web3_accounts) => {
21    accounts = web3_accounts
22  });
23  
24  contract("SimpleStorage", function () {
25    this.timeout(0);
26  
27    it("should set constructor value", async function () {
28      let result = await SimpleStorage.methods.storedData().call();
29      assert.strictEqual(parseInt(result, 10), 100);
30    });
31  
32    it("set storage value", async function () {
33      await SimpleStorage.methods.set(150).send();
34      let result = await SimpleStorage.methods.get().call();
35      assert.strictEqual(parseInt(result, 10), 150);
36    });
37  
38    it("should have account with balance", async function() {
39      let balance = await web3.eth.getBalance(accounts[0]);
40      assert.ok(parseInt(balance, 10) > 0);
41    });
42  }
43  */