Skip to content

Commit

Permalink
add switch for zeroExitCode even for failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zheng committed Mar 26, 2019
1 parent 4d10b7c commit 42e804e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion config/cli/config/listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ module.exports = [{
});
tabl.push(['TOTALS', output.totals.pass, output.totals.fail, output.totals.total]);
console.log(tabl.toString());
process.exitCode = Math.min(output.totals.fail, 255);

let zeroExitCode = context.config.get('profiles:base:zeroExitCode') || false
process.exitCode = zeroExitCode ? 0 : Math.min(output.totals.fail, 255);
if (context.program.exit) {
process.exit();
}
Expand Down
4 changes: 3 additions & 1 deletion lib/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ module.exports = function (context, instances) {
table.push(...getTableRows(output));
table.push(['TOTALS', output.totals.pass, output.totals.fail, output.totals.total]);
console.log(table.toString());
process.exitCode = Math.min(output.totals.fail, 255);

let zeroExitCode = context.config.get('profiles:base:zeroExitCode') || false
process.exitCode = zeroExitCode ? 0 : Math.min(output.totals.fail, 255);
if (context.program.exit) {
process.exit();
}
Expand Down

0 comments on commit 42e804e

Please sign in to comment.