From 50fc3d884611d946ba415c01cceb7c16d9db1cea Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Tue, 31 Jul 2018 10:48:04 +0100 Subject: [PATCH] Make sure config is called at least once --- lib/tests/run_tests.js | 3 +++ lib/tests/test.js | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/tests/run_tests.js b/lib/tests/run_tests.js index 66c7f9bf3..3b6adc40c 100644 --- a/lib/tests/run_tests.js +++ b/lib/tests/run_tests.js @@ -110,6 +110,9 @@ module.exports = { mocha.suite.timeout(0); mocha.suite.beforeAll('Wait for deploy', (done) => { + if (global.embark.needConfig) { + global.config({}); + } global.embark.onReady((err) => { done(err); }); diff --git a/lib/tests/test.js b/lib/tests/test.js index 17d298f53..26f8c9c02 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -41,7 +41,7 @@ class Test { this.builtContracts = {}; this.compiledContracts = {}; this.logsSubscription = null; - + this.needConfig = true; this.web3 = new Web3(); } @@ -212,6 +212,7 @@ class Test { config(options, callback) { const self = this; + self.needConfig = false; if (typeof (options) === 'function') { callback = options; options = {}; @@ -230,7 +231,7 @@ class Test { self.checkDeploymentOptions(options, next); }, function compileContracts(next) { - if (Object.keys(self.builtContracts).length > 0 && !self.resetServices) { + if (Object.keys(self.builtContracts).length > 0) { return next(); } console.info('Compiling contracts'.cyan);