tap-bail
Abort TAP test runners on the first failing assertion.
Similar to mocha's --bail
.
Example
With tap-bail:
$ make test | tap-bailTAP version 13# test.js # TAP version 13 # success not ok 1 --- file: /Users/julian/pro/tap-bail/test.js line: 5 column: 5 stack: - getCaller - Function.assert - Test._testAssert [as ok] - Test.src - Test.EventEmitter.emit - Test.emit - GlobalHarness.Harness.process - process._tickCallback - Function.Module.runMain - startup ...
Without tap-bail:
$ make testTAP version 13# test.js # TAP version 13 # success not ok 1 --- file: /Users/julian/pro/tap-bail/test.js line: 5 column: 5 stack: - getCaller - Function.assert - Test._testAssert [as ok] - Test.src - Test.EventEmitter.emit - Test.emit - GlobalHarness.Harness.process - process._tickCallback - Function.Module.runMain - startup ...ok 2 should be equalok 3 should be equal# fail ok 4 should be equalok 5 # tests 5 # pass 4 # fail 1 ok 6 ./test.js 1..6# tests 6 # pass 5 # fail 1 make: *** [test] Error 1
Compatibility
Since all tap-bail needs is TAP output it works with any language and any TAP producing library.
When using the node tap
module, be sure to pass --tap
in order not to
get the abbreviated output:
$ tap --tap test.js | tap-bail
Installation
$ npm install -g tap-bail
License
MIT