From 91fb1a74bcf19c79e3361929c9936e7e8b04bbfe Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Thu, 8 Aug 2019 12:00:27 -0400 Subject: [PATCH] accounts being passed around --- packages/embark-test-runner/src/index.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/embark-test-runner/src/index.js b/packages/embark-test-runner/src/index.js index 84c946843..25e06404f 100644 --- a/packages/embark-test-runner/src/index.js +++ b/packages/embark-test-runner/src/index.js @@ -266,6 +266,8 @@ class TestRunner { runJSTests(files, options, cb) { const {events} = this.embark; + + let accounts = []; let compiledContracts; let web3; @@ -283,7 +285,7 @@ class TestRunner { next(); } ], (_err) => { - acctCb([]); + acctCb(accounts); done(); }); }); @@ -297,6 +299,14 @@ class TestRunner { web3 = new Web3(bcProvider); next(); }, + (next) => { // get accounts + web3.eth.getAccounts((accts) => { + console.log('got accounts from web3'); + console.dir(accts); + accounts = accts; + next(); + }); + }, (next) => { // get contract files console.log('getting contract files'); events.request("config:contractsFiles", next); @@ -321,8 +331,13 @@ class TestRunner { next(); }, (next) => { // setup global namespace + const originalDescribe = global.describe; + global.assert = assert; global.config = config; + global.describe = (scenario, cb) => { + originalDescribe(scenario, cb(accounts)); + }; global.contract = global.describe; next(); },