tap
A Test-Anything-Protocol library
Last updated 6 years ago by isaacs .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ npm install tap 
SYNC missed versions from official npm registry.

node-tap

A TAP test framework for Node.js.

Build Status

Just wanna see some code? Get started!

It includes a command line test runner for consuming TAP-generating test scripts, and a JavaScript framework for writing such scripts.

See the changelog for recent updates, or just get started with the basics.

All this is too much to manage in a single README file, so head over to the website to learn more.

Why TAP?

Why should you use this thing!? LET ME TELL YOU!

Just kidding.

Most frameworks spend a lot of their documentation telling you why they're the greatest. I'm not going to do that.

tutti i gusti sono gusti

Software testing is a software and user experience design challenge that balances on the intersection of many conflicting demands.

Node-tap is based on my opinions about how a test framework should work, and what it should let you do. I do not have any opinion about whether or not you share those opinions. If you do share them, you will probably enjoy this test library.

  1. Test files should be "normal" programs that can be run directly.

    That means that it can't require a special runner that puts magic functions into a global space. node test.js is a perfectly ok way to run a test, and it ought to function exactly the same as when it's run by the fancy runner with reporting and such. JavaScript tests should be JavaScript programs; not english-language poems with weird punctuation.

  2. Test output should be connected to the structure of the test file that is easy to determine.

    That means not unnecessarily deferring test functions until nextTick, because that would shift the order of console.log output. Synchronous tests should be synchronous.

  3. Test files should be run in separate processes.

    That means that it can't use require() to load test files. Doing node ./test.js must be the exact same sort of environment for the test as doing test-runner ./test.js. Doing node test/1.js; node test/2.js should be equivalent (from the test's point of view) to doing test-runner test/*.js. This prevents tests from becoming implicitly dependent on one anothers' globals.

  4. Assertions should not normally throw (but throws MUST be handled nicely).

    I frequently write programs that have many hundreds of assertions based on some list of test cases. If the first failure throws, then I don't know if I've failed 100 tests or 1, without wrapping everything in a try-catch. Furthermore, I usually want to see some kind of output or reporting to verify that each one actually ran.

    Basically, it should be your decision whether you want to throw or not. The test framework shouldn't force that on you, and should make either case easy.

  5. Test reporting should be separate from the test process, included in the framework, and enabled by default for humans.

    The raw test output should be machine-parseable and human-intelligible, and a separate process should consume test output and turn it into a pretty summarized report. This means that test data can be stored and parsed later, dug into for additional details, and so on. Also: nyan cat.

  6. Writing tests should be easy, maybe even fun.

    The lower the barrier to entry for writing new tests, the more tests get written. That means that there should be a relatively small vocabulary of actions that I need to remember as a test author. There is no benefit to having a distinction between a "suite" and a "subtest". Fancy DSLs are pretty, but more to remember.

    That being said, if you return a Promise, or use a DSL that throws a decorated error, then the test framework should Just Work in a way that helps a human being understand the situation.

  7. Tests should output enough data to diagnose a failure, and no more or less.

    Stack traces pointing at JS internals or the guts of the test framework itself are not helpful. A test framework is a serious UX challenge, and should be treated with care.

  8. Test coverage should be included.

    Running tests with coverage changes the way that you think about your programs, and provides much deeper insight. Node-tap bundles nyc for this.

    It's not enabled by default only because it does necessarily change the nature of the environment a little bit. But I strongly encourage enabling coverage.

  9. Tests should be output in a predictable order.

    Even if they are run in parallel, the test output should be consistent.

    As of version 10, tap supports parallel tests, which can make your tests run significantly faster if they are I/O bound or if you have multiple cores on your machine. However, even when run in parallel, the output is still serialized.

  10. Tests should not require more building than your code.

    Babel and Webpack are lovely and fine. But if your code doesn't require compilation, then I think your tests shouldn't either. Tap is extremely promise-aware, but works on any version of Node.js back to v4.x.

Software testing should help you build software. It should be a security blanket and a quality ratchet, giving you the support to undertake massive refactoring and fix bugs without worrying. It shouldn't be a purification rite or a hazing ritual.

There are many opinions left off of this list! Reasonable people can disagree. But if you find yourself nodding along, maybe tap is for you.

Current Tags

  • 21.0.0                                ...           latest (6 months ago)
  • 12.7.0                                ...           legacy (6 years ago)
  • 16.3.10                                ...           legacy-v16 (a year ago)
  • 14.10.2-totally-bundled.1                                ...           totally-bundled (5 years ago)
  • 14.10.2-unbundled                                ...           unbundled (5 years ago)
  • 14.11.0                                ...           v14-legacy (4 years ago)
  • 15.0.0-3                                ...           v15-beta (4 years ago)

417 Versions

  • 21.0.0                                ...           6 months ago
  • 20.0.3                                ...           6 months ago
  • 20.0.2                                ...           6 months ago
  • 20.0.1                                ...           6 months ago
  • 20.0.0                                ...           6 months ago
  • 19.2.5                                ...           6 months ago
  • 19.2.4                                ...           6 months ago
  • 19.2.3                                ...           6 months ago
  • 19.2.2                                ...           7 months ago
  • 19.2.1                                ...           7 months ago
  • 19.2.0                                ...           7 months ago
  • 19.1.1                                ...           7 months ago
  • 19.1.0                                ...           7 months ago
  • 19.0.2                                ...           7 months ago
  • 19.0.1                                ...           7 months ago
  • 19.0.0                                ...           7 months ago
  • 18.8.0                                ...           7 months ago
  • 18.7.3                                ...           8 months ago
  • 18.7.2                                ...           9 months ago
  • 18.7.1                                ...           10 months ago
  • 18.7.0                                ...           a year ago
  • 16.3.10                                ...           a year ago
  • 18.6.1                                ...           a year ago
  • 18.6.0                                ...           a year ago
  • 18.5.8                                ...           a year ago
  • 18.5.7                                ...           a year ago
  • 18.5.6                                ...           a year ago
  • 18.5.5                                ...           a year ago
  • 18.5.4                                ...           a year ago
  • 18.5.3                                ...           a year ago
  • 18.5.2                                ...           a year ago
  • 18.5.1                                ...           a year ago
  • 18.5.0                                ...           a year ago
  • 18.4.6                                ...           a year ago
  • 18.4.5                                ...           a year ago
  • 18.4.4                                ...           a year ago
  • 18.4.3                                ...           a year ago
  • 18.4.2                                ...           a year ago
  • 18.4.1                                ...           a year ago
  • 18.4.0                                ...           a year ago
  • 18.3.1                                ...           a year ago
  • 18.3.0                                ...           a year ago
  • 18.2.2                                ...           a year ago
  • 18.2.1                                ...           a year ago
  • 18.2.0                                ...           a year ago
  • 16.3.9                                ...           a year ago
  • 18.1.5                                ...           a year ago
  • 18.1.4                                ...           a year ago
  • 18.1.3                                ...           a year ago
  • 18.1.2                                ...           a year ago
  • 18.1.1                                ...           a year ago
  • 18.1.0                                ...           a year ago
  • 18.0.4                                ...           a year ago
  • 18.0.3                                ...           a year ago
  • 18.0.2                                ...           a year ago
  • 18.0.1                                ...           a year ago
  • 18.0.0                                ...           a year ago
  • 18.0.0-26                                ...           a year ago
  • 18.0.0-25                                ...           a year ago
  • 18.0.0-24                                ...           a year ago
  • 18.0.0-23                                ...           a year ago
  • 18.0.0-22                                ...           a year ago
  • 18.0.0-21                                ...           a year ago
  • 18.0.0-20                                ...           a year ago
  • 18.0.0-19                                ...           a year ago
  • 18.0.0-18                                ...           a year ago
  • 18.0.0-17                                ...           a year ago
  • 18.0.0-16                                ...           a year ago
  • 18.0.0-15                                ...           a year ago
  • 18.0.0-14                                ...           a year ago
  • 18.0.0-13                                ...           a year ago
  • 18.0.0-12                                ...           a year ago
  • 18.0.0-11                                ...           a year ago
  • 18.0.0-10                                ...           a year ago
  • 18.0.0-9                                ...           a year ago
  • 18.0.0-8                                ...           a year ago
  • 18.0.0-7                                ...           a year ago
  • 18.0.0-6                                ...           a year ago
  • 18.0.0-5                                ...           a year ago
  • 18.0.0-4                                ...           a year ago
  • 18.0.0-3                                ...           a year ago
  • 18.0.0-2                                ...           a year ago
  • 18.0.0-1                                ...           a year ago
  • 16.3.8                                ...           a year ago
  • 16.3.7                                ...           2 years ago
  • 16.3.6                                ...           2 years ago
  • 16.3.5                                ...           2 years ago
  • 16.3.4                                ...           2 years ago
  • 16.3.3                                ...           2 years ago
  • 16.3.2                                ...           2 years ago
  • 16.3.1                                ...           2 years ago
  • 16.3.0                                ...           3 years ago
  • 16.2.0                                ...           3 years ago
  • 16.1.0                                ...           3 years ago
  • 16.0.1                                ...           3 years ago
  • 16.0.0                                ...           3 years ago
  • 15.2.3                                ...           3 years ago
  • 15.2.2                                ...           3 years ago
  • 15.2.1                                ...           3 years ago
  • 15.2.0                                ...           3 years ago
  • 15.1.6                                ...           3 years ago
  • 15.1.5                                ...           3 years ago
  • 15.1.4                                ...           3 years ago
  • 15.1.3                                ...           3 years ago
  • 15.1.2                                ...           3 years ago
  • 15.1.1                                ...           3 years ago
  • 15.1.0                                ...           3 years ago
  • 15.0.10                                ...           3 years ago
  • 15.0.9                                ...           4 years ago
  • 15.0.8                                ...           4 years ago
  • 15.0.7                                ...           4 years ago
  • 15.0.6                                ...           4 years ago
  • 15.0.5                                ...           4 years ago
  • 15.0.4                                ...           4 years ago
  • 15.0.3                                ...           4 years ago
  • 15.0.2                                ...           4 years ago
  • 15.0.1                                ...           4 years ago
  • 15.0.0                                ...           4 years ago
  • 15.0.0-3                                ...           4 years ago
  • 15.0.0-2                                ...           4 years ago
  • 15.0.0-1                                ...           4 years ago
  • 15.0.0-0                                ...           4 years ago
  • 14.11.0                                ...           4 years ago
  • 14.10.8                                ...           4 years ago
  • 14.10.7                                ...           5 years ago
  • 14.10.6                                ...           5 years ago
  • 14.10.5                                ...           5 years ago
  • 14.10.4                                ...           5 years ago
  • 14.10.3                                ...           5 years ago
  • 14.10.2-totally-bundled.1                                ...           5 years ago
  • 14.10.2-totally-bundled                                ...           5 years ago
  • 14.10.2-unbundled                                ...           5 years ago
  • 14.10.2                                ...           5 years ago
  • 14.10.1                                ...           5 years ago
  • 14.10.0                                ...           5 years ago
  • 14.9.2                                ...           5 years ago
  • 14.9.1                                ...           5 years ago
  • 14.9.0                                ...           5 years ago
  • 14.8.3                                ...           5 years ago
  • 14.8.2                                ...           5 years ago
  • 14.8.1                                ...           5 years ago
  • 14.8.0                                ...           5 years ago
  • 14.7.3                                ...           5 years ago
  • 14.7.2                                ...           5 years ago
  • 14.7.1                                ...           5 years ago
  • 14.7.0                                ...           5 years ago
  • 14.6.9                                ...           5 years ago
  • 14.6.8                                ...           5 years ago
  • 14.6.7                                ...           5 years ago
  • 14.6.6                                ...           5 years ago
  • 14.6.5                                ...           5 years ago
  • 14.6.4                                ...           5 years ago
  • 14.6.3                                ...           5 years ago
  • 14.6.2                                ...           5 years ago
  • 14.6.1                                ...           5 years ago
  • 14.6.0                                ...           5 years ago
  • 14.5.0                                ...           5 years ago
  • 14.4.3                                ...           5 years ago
  • 14.4.2                                ...           5 years ago
  • 14.4.1                                ...           5 years ago
  • 14.4.0                                ...           5 years ago
  • 14.3.1                                ...           5 years ago
  • 14.3.0                                ...           6 years ago
  • 14.2.5                                ...           6 years ago
  • 14.2.4                                ...           6 years ago
  • 14.2.3                                ...           6 years ago
  • 14.2.2                                ...           6 years ago
  • 14.2.1                                ...           6 years ago
  • 14.2.0                                ...           6 years ago
  • 14.1.11                                ...           6 years ago
  • 14.1.10                                ...           6 years ago
  • 14.1.9                                ...           6 years ago
  • 14.1.8                                ...           6 years ago
  • 14.1.7                                ...           6 years ago
  • 14.1.6                                ...           6 years ago
  • 14.1.5                                ...           6 years ago
  • 14.1.4                                ...           6 years ago
  • 14.1.3                                ...           6 years ago
  • 14.1.2                                ...           6 years ago
  • 14.1.1                                ...           6 years ago
  • 14.1.0                                ...           6 years ago
  • 14.0.0                                ...           6 years ago
  • 13.1.11                                ...           6 years ago
  • 13.1.10                                ...           6 years ago
  • 13.1.9                                ...           6 years ago
  • 13.1.8                                ...           6 years ago
  • 13.1.7                                ...           6 years ago
  • 13.1.6                                ...           6 years ago
  • 13.1.5                                ...           6 years ago
  • 13.1.4                                ...           6 years ago
  • 13.1.3                                ...           6 years ago
  • 13.1.2                                ...           6 years ago
  • 13.1.1                                ...           6 years ago
  • 12.7.0                                ...           6 years ago
  • 13.1.0                                ...           6 years ago
  • 13.0.4                                ...           6 years ago
  • 13.0.3                                ...           6 years ago
  • 12.6.6                                ...           6 years ago
  • 13.0.1                                ...           6 years ago
  • 13.0.0                                ...           6 years ago
  • 12.6.5                                ...           6 years ago
  • 13.0.0-rc.30                                ...           6 years ago
  • 13.0.0-rc.29                                ...           6 years ago
  • 12.6.4                                ...           6 years ago
  • 13.0.0-rc.28                                ...           6 years ago
  • 13.0.0-rc.27                                ...           6 years ago
  • 13.0.0-rc.26                                ...           6 years ago
  • 12.6.3                                ...           6 years ago
  • 13.0.0-rc.25                                ...           6 years ago
  • 12.6.2                                ...           6 years ago
  • 13.0.0-rc.24                                ...           6 years ago
  • 13.0.0-rc.23                                ...           6 years ago
  • 13.0.0-rc.22                                ...           6 years ago
  • 13.0.0-rc.21                                ...           6 years ago
  • 13.0.0-rc.20                                ...           6 years ago
  • 13.0.0-rc.19                                ...           6 years ago
  • 13.0.0-rc.18                                ...           6 years ago
  • 13.0.0-rc.17                                ...           6 years ago
  • 13.0.0-rc.16                                ...           6 years ago
  • 13.0.0-rc.15                                ...           6 years ago
  • 13.0.0-rc.14                                ...           6 years ago
  • 12.6.1                                ...           6 years ago
  • 13.0.0-rc.13                                ...           6 years ago
  • 13.0.0-rc.12                                ...           6 years ago
  • 13.0.0-rc.11                                ...           6 years ago
  • 13.0.0-rc.10                                ...           6 years ago
  • 13.0.0-rc.9                                ...           6 years ago
  • 13.0.0-rc.8                                ...           6 years ago
  • 13.0.0-rc.7                                ...           6 years ago
  • 13.0.0-rc.6                                ...           6 years ago
  • 13.0.0-rc.5                                ...           6 years ago
  • 13.0.0-rc.4                                ...           6 years ago
  • 13.0.0-rc.3                                ...           6 years ago
  • 13.0.0-rc.2                                ...           6 years ago
  • 13.0.0-rc.1                                ...           6 years ago
  • 13.0.0-rc.0                                ...           6 years ago
  • 12.6.0                                ...           6 years ago
  • 12.5.3                                ...           6 years ago
  • 12.5.2                                ...           6 years ago
  • 12.5.1                                ...           6 years ago
  • 12.5.0                                ...           6 years ago
  • 12.4.1                                ...           6 years ago
  • 12.4.0                                ...           6 years ago
  • 12.3.0                                ...           6 years ago
  • 12.2.1                                ...           6 years ago
  • 12.2.0                                ...           6 years ago
  • 12.1.4                                ...           6 years ago
  • 12.1.3                                ...           6 years ago
  • 12.1.2                                ...           6 years ago
  • 12.1.1                                ...           6 years ago
  • 12.1.0                                ...           6 years ago
  • 12.0.2                                ...           6 years ago
  • 12.0.1                                ...           7 years ago
  • 12.0.0                                ...           7 years ago
  • 11.1.5                                ...           7 years ago
  • 11.1.4                                ...           7 years ago
  • 11.1.3                                ...           7 years ago
  • 11.1.2                                ...           7 years ago
  • 11.1.1                                ...           7 years ago
  • 11.1.0                                ...           7 years ago
  • 11.0.1                                ...           7 years ago
  • 11.0.0                                ...           7 years ago
  • 11.0.0-rc.3                                ...           7 years ago
  • 11.0.0-rc.2                                ...           7 years ago
  • 11.0.0-rc.1                                ...           7 years ago
  • 11.0.0-rc.0                                ...           7 years ago
  • 10.7.3                                ...           7 years ago
  • 10.7.2                                ...           7 years ago
  • 10.7.1                                ...           7 years ago
  • 10.7.0                                ...           8 years ago
  • 10.6.0                                ...           8 years ago
  • 10.5.2                                ...           8 years ago
  • 10.5.1                                ...           8 years ago
  • 10.5.0                                ...           8 years ago
  • 10.4.0                                ...           8 years ago
  • 10.3.4                                ...           8 years ago
  • 10.3.3                                ...           8 years ago
  • 10.3.2                                ...           8 years ago
  • 10.3.1                                ...           8 years ago
  • 10.3.0                                ...           8 years ago
  • 10.2.2                                ...           8 years ago
  • 10.2.1                                ...           8 years ago
  • 10.2.0                                ...           8 years ago
  • 10.1.2                                ...           8 years ago
  • 10.1.1                                ...           8 years ago
  • 10.1.0                                ...           8 years ago
  • 10.0.2                                ...           8 years ago
  • 10.0.1                                ...           8 years ago
  • 10.0.0                                ...           8 years ago
  • 9.0.3                                ...           8 years ago
  • 9.0.2                                ...           8 years ago
  • 9.0.1                                ...           8 years ago
  • 9.0.0                                ...           8 years ago
  • 8.0.1                                ...           8 years ago
  • 8.0.0                                ...           8 years ago
  • 7.1.2                                ...           8 years ago
  • 7.1.1                                ...           8 years ago
  • 7.1.0                                ...           8 years ago
  • 7.0.1                                ...           8 years ago
  • 7.0.0                                ...           8 years ago
  • 6.3.2                                ...           8 years ago
  • 6.3.0                                ...           8 years ago
  • 6.2.0                                ...           8 years ago
  • 6.1.1                                ...           8 years ago
  • 6.1.0                                ...           8 years ago
  • 6.0.0                                ...           8 years ago
  • 5.8.0                                ...           9 years ago
  • 5.7.3                                ...           9 years ago
  • 5.7.2                                ...           9 years ago
  • 5.7.1                                ...           9 years ago
  • 5.7.0                                ...           9 years ago
  • 5.6.0                                ...           9 years ago
  • 5.5.0                                ...           9 years ago
  • 5.4.5                                ...           9 years ago
  • 5.4.4                                ...           9 years ago
  • 5.4.3                                ...           9 years ago
  • 5.4.2                                ...           9 years ago
  • 5.4.1                                ...           9 years ago
  • 5.4.0                                ...           9 years ago
  • 5.3.0                                ...           9 years ago
  • 5.2.0                                ...           9 years ago
  • 5.1.2                                ...           9 years ago
  • 5.1.1                                ...           9 years ago
  • 5.1.0                                ...           9 years ago
  • 5.0.1                                ...           9 years ago
  • 5.0.0                                ...           9 years ago
  • 4.0.0                                ...           9 years ago
  • 3.1.2                                ...           9 years ago
  • 3.1.1                                ...           9 years ago
  • 3.1.0                                ...           9 years ago
  • 3.0.0                                ...           9 years ago
  • 2.3.4                                ...           9 years ago
  • 2.3.3                                ...           9 years ago
  • 2.3.2                                ...           9 years ago
  • 2.3.1                                ...           9 years ago
  • 2.3.0                                ...           9 years ago
  • 2.2.1                                ...           9 years ago
  • 2.2.0                                ...           9 years ago
  • 2.1.1                                ...           9 years ago
  • 2.1.0                                ...           9 years ago
  • 2.0.1                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
  • 1.4.1                                ...           9 years ago
  • 1.4.0                                ...           9 years ago
  • 1.3.4                                ...           9 years ago
  • 1.3.3                                ...           9 years ago
  • 1.3.2                                ...           9 years ago
  • 1.3.1                                ...           10 years ago
  • 1.3.0                                ...           10 years ago
  • 1.2.1                                ...           10 years ago
  • 1.2.0                                ...           10 years ago
  • 1.1.4                                ...           10 years ago
  • 1.1.3                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.10                                ...           10 years ago
  • 1.0.8                                ...           10 years ago
  • 1.0.7                                ...           10 years ago
  • 1.0.6                                ...           10 years ago
  • 1.0.5                                ...           10 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
  • 1.0.0-beta.5                                ...           10 years ago
  • 1.0.0-beta.4                                ...           10 years ago
  • 1.0.0-beta.3                                ...           10 years ago
  • 1.0.0-beta.2                                ...           10 years ago
  • 1.0.0-beta.1                                ...           10 years ago
  • 1.0.0-beta.0                                ...           10 years ago
  • 0.7.1                                ...           10 years ago
  • 0.7.0                                ...           10 years ago
  • 0.6.0                                ...           10 years ago
  • 0.5.0                                ...           10 years ago
  • 0.4.13                                ...           10 years ago
  • 0.4.12                                ...           10 years ago
  • 0.4.11                                ...           11 years ago
  • 0.4.9                                ...           11 years ago
  • 0.4.8                                ...           11 years ago
  • 0.4.7                                ...           11 years ago
  • 0.4.6                                ...           11 years ago
  • 0.4.5                                ...           11 years ago
  • 0.4.4                                ...           11 years ago
  • 0.4.3                                ...           12 years ago
  • 0.4.2                                ...           12 years ago
  • 0.4.1                                ...           12 years ago
  • 0.4.0                                ...           12 years ago
  • 0.3.3                                ...           12 years ago
  • 0.3.2                                ...           12 years ago
  • 0.3.1                                ...           12 years ago
  • 0.3.0                                ...           12 years ago
  • 0.2.6                                ...           12 years ago
  • 0.2.5                                ...           13 years ago
  • 0.2.4                                ...           13 years ago
  • 0.2.3                                ...           13 years ago
  • 0.2.2                                ...           13 years ago
  • 0.2.1                                ...           13 years ago
  • 0.2.0                                ...           13 years ago
  • 0.1.4                                ...           13 years ago
  • 0.1.3                                ...           13 years ago
  • 0.1.2                                ...           13 years ago
  • 0.0.7                                ...           13 years ago
  • 0.0.6                                ...           13 years ago
  • 0.0.4                                ...           13 years ago
  • 0.0.1                                ...           13 years ago
  • 0.0.5                                ...           13 years ago
  • 0.0.3                                ...           13 years ago
  • 0.0.2                                ...           13 years ago
  • 0.1.1                                ...           13 years ago
  • 0.0.9                                ...           13 years ago
  • 0.0.8                                ...           13 years ago
  • 0.1.0                                ...           13 years ago
  • 0.0.14                                ...           13 years ago
  • 0.0.13                                ...           13 years ago
  • 0.0.12                                ...           13 years ago
  • 0.0.11                                ...           13 years ago
  • 0.0.10                                ...           13 years ago
Maintainers (1)
Downloads
Total 267
Today 0
This Week 0
This Month 260
Last Day 0
Last Week 260
Last Month 0
Dependencies (39)
Dev Dependencies (1)

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