Make sure config is called at least once

This commit is contained in:
Anthony Laibe 2018-07-31 10:48:04 +01:00
parent ec9949d70e
commit 50fc3d8846
2 changed files with 6 additions and 2 deletions

View File

@ -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);
});

View File

@ -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);