Skip to content

Commit

Permalink
Bugfix: test.fail() didn't work as documented.
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon committed Apr 4, 2011
1 parent 962b860 commit d7bce52
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bin/zap
Expand Up @@ -14,10 +14,8 @@ if (process.argv[2] === '--one') {
},
_finished: 0,
fail: function (message) {
return function () {
sys.puts("Test failed: ", message)
process.exit(1)
}
sys.print("Test failed: ", message, "\n")
process.exit(1)
},
}
process.on('exit', function (code) {
Expand Down
8 changes: 8 additions & 0 deletions test/fail.test.js
@@ -0,0 +1,8 @@
var assert = require('assert')

module.exports = {
'test that thingy': function (test) {
test.fail("should end...")
test.finish()
}
}

0 comments on commit d7bce52

Please sign in to comment.