embark/dapps/tests/app/test/array_references_spec.js

40 lines
873 B
JavaScript
Raw Normal View History

2018-08-14 17:36:08 +00:00
/*global contract, config, it, web3*/
2018-06-01 14:48:29 +00:00
const assert = require('assert');
2018-06-07 20:14:42 +00:00
const SomeContract = require('Embark/contracts/SomeContract');
const MyToken2 = require('Embark/contracts/MyToken2');
2018-06-01 14:48:29 +00:00
config({
contracts: {
"Token": {
deploy: false,
args: [1000]
},
"MyToken2": {
instanceOf: "Token",
args: [2000]
},
"SomeContract": {
"args": [
2018-08-14 17:36:08 +00:00
["$MyToken2", "$accounts[0]"],
2018-06-01 14:48:29 +00:00
100
]
}
}
});
contract("SomeContract", function() {
this.timeout(0);
2018-04-17 18:48:31 +00:00
it("set MyToken2 address", async function() {
let address = await SomeContract.methods.addr_1().call();
2018-06-01 14:48:29 +00:00
assert.strictEqual(address, MyToken2.options.address);
});
2018-08-14 17:36:08 +00:00
it("set account address", async function() {
2018-04-17 18:48:31 +00:00
let address = await SomeContract.methods.addr_2().call();
2018-08-14 17:36:08 +00:00
assert.strictEqual(address, web3.eth.defaultAccount);
});
});