don't continue testing file if there was deploy errors; avoids unrelated errors for each 'it'

This commit is contained in:
Iuri Matias 2018-06-08 06:14:46 -04:00
parent 3db8ccd44e
commit ede4926069
2 changed files with 8 additions and 5 deletions

View File

@ -83,8 +83,8 @@ module.exports = {
mocha.suite.timeout(0); mocha.suite.timeout(0);
mocha.suite.beforeAll('Wait for deploy', (done) => { mocha.suite.beforeAll('Wait for deploy', (done) => {
global.embark.onReady(() => { global.embark.onReady((err) => {
done(); done(err);
}); });
}); });

View File

@ -117,6 +117,9 @@ class Test {
this.events.once('ready', () => { this.events.once('ready', () => {
callback(); callback();
}); });
this.events.once('deployError', (err) => {
callback(err);
});
} }
config(options, callback) { config(options, callback) {
@ -175,12 +178,12 @@ class Test {
}, },
function deploy(next) { function deploy(next) {
self._deploy(options, (err, accounts) => { self._deploy(options, (err, accounts) => {
self.ready = true;
self.events.emit('ready');
if (err) { if (err) {
console.error(err.red); self.events.emit('deployError', err);
return next(err); return next(err);
} }
self.ready = true;
self.events.emit('ready');
next(null, accounts); next(null, accounts);
}); });
} }