Permalink
Browse files

Return 1 if any test failed.

  • Loading branch information...
1 parent 8cedf0a commit 3041d778191b1242c2aaa1c1d2fc114bbc0f3d62 @nornagon committed Nov 18, 2012
Showing with 7 additions and 2 deletions.
  1. +6 −1 bin/zap
  2. +1 −1 package.json
View
@@ -136,6 +136,7 @@ if (process.argv[2] === '--one') {
runner.stderr.on('data', function (data) { output += data })
}
+ var numFailures = 0
function runPar() {
var ordered = { upTo: 0 }
function inOrder(n, cb) {
@@ -165,6 +166,7 @@ if (process.argv[2] === '--one') {
inOrder(o, function () { util.print(name(t), "... ") })
runOne(t, function (err) {
if (err) {
+ numFailures++
inOrder(o, function () {
util.puts("\x1b[1;31mfailed\x1b[0m")
util.puts(err)
@@ -184,5 +186,8 @@ if (process.argv[2] === '--one') {
}
}
+ process.on('exit', function() {
+ process.reallyExit(numFailures ? 1 : 0)
+ })
runPar()
-}
+}
View
@@ -8,5 +8,5 @@
"author" : "Jeremy Apthorp <nornagon@nornagon.net>",
"bin" : { "zap": "./bin/zap" },
"preferGlobal": true,
- "version" : "0.2.4-3"
+ "version" : "0.2.5"
}

0 comments on commit 3041d77

Please sign in to comment.