/ test / contract_spec.js
contract_spec.js
 1  /*global artifacts, contract, it*/
 2  /*
 3  const SimpleStorage = artifacts.require('SimpleStorage');
 4  
 5  let accounts;
 6  
 7  // For documentation please see https://framework.embarklabs.io/docs/contracts_testing.html
 8  config({
 9    //deployment: {
10    //  accounts: [
11    //    // you can configure custom accounts with a custom balance
12    //    // see https://framework.embarklabs.io/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.skip("SimpleStorage", function () {
25  
26    it("should set constructor value", async function () {
27      let result = await SimpleStorage.methods.storedData().call();
28      assert.strictEqual(parseInt(result, 10), 100);
29    });
30  
31    it("set storage value", async function () {
32      await SimpleStorage.methods.set(150).send();
33      let result = await SimpleStorage.methods.get().call();
34      assert.strictEqual(parseInt(result, 10), 150);
35    });
36  
37    it("should have account with balance", async function() {
38      let balance = await web3.eth.getBalance(accounts[0]);
39      assert.ok(parseInt(balance, 10) > 0);
40    });
41  });