Skip to content

Instantly share code, notes, and snippets.

@Hypercubed
Last active June 6, 2016 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hypercubed/f0e4514bc9aec5cc5c9e814bbc1dab2d to your computer and use it in GitHub Desktop.
Save Hypercubed/f0e4514bc9aec5cc5c9e814bbc1dab2d to your computer and use it in GitHub Desktop.

To test

$ node ./example/test-error.js
$ echo $?   # prints 1, an error
1

$ node ./example/test-error.js | tap-summary
$ echo $?   # prints 0, no error
0

$ node ./example/test-error.js | ./bin/cmd.js # as modified in PR
$ echo $?  # prints 1, an error
1
var test = require('tape')
var math = require('./math')
test('t.plan', function(t) {
t.plan(3)
t.equal(
math.toFixed(2.385, 2),
'2.39'
)
next(function () {
t.whatIsThisFunction(); // causes an uncaught error
t.equal(
math.toFixed(2.384, 2),
'2.38'
)
t.equal(
math.toFixed(2, 2),
'2.00'
)
})
})
function next(fn) {
setTimeout(function() {
fn()
}, 100)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment