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

Commit

Permalink
Hotfix for test runners
Browse files Browse the repository at this point in the history
  • Loading branch information
eliperelman committed Jun 19, 2017
1 parent c3d7020 commit 02a3a63
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion packages/neutrino-preset-karma/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ module.exports = (neutrino, tap) => {
karma.files = files;
}

return new Promise(resolve => new Server(karma, resolve).start());
return new Promise((resolve, reject) => new Server(
karma,
exitCode => (exitCode !== 0 ? reject() : resolve())
).start());
});
};
2 changes: 1 addition & 1 deletion packages/neutrino-preset-karma/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neutrino-preset-karma",
"version": "5.9.0",
"version": "5.9.1",
"description": "Neutrino preset for testing Neutrino projects with Karma",
"main": "index.js",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/neutrino-preset-mocha/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neutrino-preset-mocha",
"version": "5.9.0",
"version": "5.9.1",
"description": "Neutrino preset for testing Neutrino projects with Mocha",
"main": "src/index.js",
"keywords": [
Expand Down
6 changes: 3 additions & 3 deletions packages/neutrino-preset-mocha/src/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ 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();
}

if (files.length) {
Object.assign(mochaOpts, { recursive: true });
mochaOpts.recursive = true;
}

process.env.NEUTRINO_BABEL_CONFIG = JSON.stringify(babelOpts);
Expand All @@ -30,5 +30,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 02a3a63

Please sign in to comment.