tape-catch
a wrapper around tape that catches and reports exceptions
Last updated 10 years ago by michaelrhodes .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install tape-catch 
SYNC missed versions from official npm registry.

tape-catch

tape-catch is a wrapper around tape that reports uncaught errors in your tests. It re-adds functionality that was removed from tape in version 3.0.0.

Build status

install

$ npm install tape-catch

note: tape is not installed alongside tape-catch.

tape-catch works with any and all versions of tape, so it leaves this choice to the user.

example

var test = require('tape-catch')

test('cause an exception', function (assert) {
  asdf
})

test('still run this test', function (assert) {
  assert.equal(1 + 1, 2, 'this still ran')
  assert.end() 
})
TAP version 13
# cause an exception
not ok 1 ReferenceError: asdf is not defined
  ---
    operator: error
    expected: undefined
    actual:   {}
    stack:
      ReferenceError: asdf is not defined
        at Test.<anonymous> (/path/to/example.js:4:3)
        at Test.bound [as _cb] (/path/to/node_modules/tape/lib/test.js:59:32)
        at Test.exports.Test.run (/path/to/index.js:17:10)
        at Test.bound [as run] (/path/to/node_modules/tape/lib/test.js:59:32)
        at Object.next [as _onImmediate] (/path/to/node_modules/tape/lib/results.js:66:15)
        at processImmediate [as _immediateCallback] (timers.js:345:15)
  ...
# still run this test
ok 2 this still ran

1..2
# tests 2
# pass  1
# fail  1

license

MIT

Current Tags

  • 1.0.6                                ...           latest (8 years ago)

7 Versions

  • 1.0.6                                ...           8 years ago
  • 1.0.5                                ...           9 years ago
  • 1.0.4                                ...           10 years ago
  • 1.0.3                                ...           10 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (7)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE