Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Reject test runners when non-zero exit code (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliperelman authored Jun 19, 2017
1 parent d957604 commit 1435477
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/neutrino-preset-karma/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ module.exports = (neutrino, opts = {}) => {
}
};

neutrino.on('test', ({ files, watch }) => new Promise(resolve =>
neutrino.on('test', ({ files, watch }) => new Promise((resolve, reject) =>
new Server(merge.all([
opts.override ? opts : merge(defaults, opts),
{ singleRun: !watch, autoWatch: watch, webpack: omit(['plugins'], neutrino.config.toConfig()) },
files && files.length ? { files } : {}
]), resolve)
]), exitCode => (exitCode !== 0 ? reject() : resolve()))
.start()
));
};
4 changes: 2 additions & 2 deletions packages/neutrino-preset-mocha/src/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const toParam = require('change-case').paramCase;

let proc;

module.exports = (mochaOpts = {}, babelOpts = {}, files = []) => new Promise((resolve) => {
module.exports = (mochaOpts = {}, babelOpts = {}, files = []) => new Promise((resolve, reject) => {
if (proc) {
proc.kill();
}
Expand All @@ -26,5 +26,5 @@ module.exports = (mochaOpts = {}, babelOpts = {}, files = []) => new Promise((re
stdio: 'inherit'
});

proc.on('close', resolve);
proc.on('close', code => (code !== 0 ? reject() : resolve()));
});

0 comments on commit 1435477

Please sign in to comment.