Skip to content

Commit

Permalink
Support old nodes that did not respect process.exitCode
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 18, 2017
1 parent 9f5568d commit 0aa4202
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/tap.js
Expand Up @@ -53,8 +53,11 @@ function onExitEvent (code) {
if (!tap.results)
tap.endAll()

if (tap.results && !tap.results.ok && code === 0)
if (tap.results && !tap.results.ok && code === 0) {
process.exitCode = 1
if (process.version.match(/^v0\.(10|[0-9])\./))
process.exit(code)
}

return process.exitCode || code || 0
}
Expand Down

0 comments on commit 0aa4202

Please sign in to comment.