array_references_spec.js
1 /*global contract, config, it*/ 2 const assert = require('assert'); 3 const SomeContract = require('Embark/contracts/SomeContract'); 4 const SimpleStorage = require('Embark/contracts/SimpleStorage'); 5 const MyToken2 = require('Embark/contracts/MyToken2'); 6 7 config({ 8 contracts: { 9 "SimpleStorage": { 10 args: [100] 11 }, 12 "Token": { 13 deploy: false, 14 args: [1000] 15 }, 16 "MyToken2": { 17 instanceOf: "Token", 18 args: [2000] 19 }, 20 "SomeContract": { 21 "args": [ 22 ["$MyToken2", "$SimpleStorage"], 23 100 24 ] 25 } 26 } 27 }); 28 29 contract("SomeContract", function() { 30 this.timeout(0); 31 32 it("set MyToken2 address", async function() { 33 let address = await SomeContract.methods.addr_1().call(); 34 assert.strictEqual(address, MyToken2.options.address); 35 }); 36 37 it("set SimpleStorage address", async function() { 38 let address = await SomeContract.methods.addr_2().call(); 39 assert.strictEqual(address, SimpleStorage.options.address); 40 }); 41 42 }); 43