diff --git a/lib/tests/run_tests.js b/lib/tests/run_tests.js index eb31209ae..0ed32c7c6 100644 --- a/lib/tests/run_tests.js +++ b/lib/tests/run_tests.js @@ -83,8 +83,8 @@ module.exports = { mocha.suite.timeout(0); mocha.suite.beforeAll('Wait for deploy', (done) => { - global.embark.onReady(() => { - done(); + global.embark.onReady((err) => { + done(err); }); }); diff --git a/lib/tests/test.js b/lib/tests/test.js index 4f9d10755..bc9b5abe0 100644 --- a/lib/tests/test.js +++ b/lib/tests/test.js @@ -117,6 +117,9 @@ class Test { this.events.once('ready', () => { callback(); }); + this.events.once('deployError', (err) => { + callback(err); + }); } config(options, callback) { @@ -175,12 +178,12 @@ class Test { }, function deploy(next) { self._deploy(options, (err, accounts) => { - self.ready = true; - self.events.emit('ready'); if (err) { - console.error(err.red); + self.events.emit('deployError', err); return next(err); } + self.ready = true; + self.events.emit('ready'); next(null, accounts); }); }