Tape

What Tape is
Tape is a test harness for Node.js and web browsers that produces TAP version 13 output. Its results include test names, assertion outcomes, and a summary. Tests can run through Node.js or the `tape` command-line binary, which supports file globbing. The API includes assertions for truthiness, equality, deep equality, exceptions, and pattern matching. For asynchronous tests, callbacks can return promises; explicit planning and timeout methods are also available. Tape has a minimal core, with companion modules such as `tap-spec`, `tap-json`, and `tap-junit` listed for formatting and reporting. The `--no-only` option makes a run fail if a `.only` test is present. Tape is free and open source under the MIT license. One behavior to account for is that uncaught exceptions in tests are not intercepted by default, so Tape crashes; `tape-catch` is suggested for reporting them as TAP errors. The README gives `npm install tape --save-dev` as the installation command.
Who it suits
Tape suits developers writing tests for Node.js or browser code who want TAP output and a focused assertion API. Its companion modules may suit teams that need additional formatting or reporting.
What it does well
- Runs tests in Node.js and web browsers
- Emits TAP version 13 results
- Supports promises and async-test planning
- Offers a `--no-only` CI option
- Free, open-source, MIT licensed
What to know first
- Uncaught test exceptions cause a crash by default
- Additional features generally require other modules
Limits
Tape keeps a minimal core, so formatting, reporting, and other capabilities may require separate modules. Uncaught test exceptions are not intercepted by default and crash the run.
Getting started
- Install Tape with `npm install tape --save-dev`
- Write tests using the Tape assertion API
- Run tests through Node.js or the `tape` command-line binary
- Use file globbing to select test files
- Add companion modules for TAP formatting or reporting if needed
Verdict
Tape provides a focused test harness with asynchronous test support and TAP output. Teams should account for its default handling of uncaught exceptions and its reliance on companion modules for added functionality.
Questions
Is Tape free?
Yes. Tape is free, open-source software listed as MIT licensed.
Which runtimes does Tape support?
Tape supports Node.js and web browsers.
How is Tape installed?
The README provides `npm install tape --save-dev`.
What assertion types are included?
The API includes truthiness, equality, deep equality, exception, and pattern-matching assertions.
Can Tape run asynchronous tests?
Yes. Test callbacks can return promises, and Tape provides explicit planning and timeout methods.
What happens to uncaught test exceptions?
By default, Tape does not intercept them, so they cause Tape to crash. The README suggests `tape-catch` to report them as TAP errors.
Facts from Tape's own pages
- Assertions
- Its assertion methods include truthy, equality, deep equality, exception, and pattern-matching assertions. · github.com, 9 Oct 2026
- Async tests
- Tape implicitly awaits a test callback that returns a Promise and fails the test if that Promise rejects. · github.com, 9 Oct 2026
- CI option
- The `--no-only` option makes a test run fail if a `.only` test is present. · github.com, 9 Oct 2026
- Extensibility
- Tape describes its core as minimal and says additional features are usually added through other modules. · github.com, 4 Oct 2026
- Install
- The README recommends installing Tape with `npm install tape --save-dev`. · github.com, 9 Oct 2026
- Installation
- The README gives `npm install tape --save-dev` as the installation command. · github.com, 4 Oct 2026
- Integrations
- The README lists companion modules for TAP reporters, including tap-spec, tap-dot, faucet, tap-json, and tap-xunit. · github.com, 9 Oct 2026
- License
- The repository identifies Tape's license as MIT. · github.com, 9 Oct 2026
- Minimal core
- The README describes Tape as having a minimal core and says additional features are usually added with other modules. · github.com, 9 Oct 2026
- Notable limitation
- By default, uncaught exceptions in tests are not intercepted and cause Tape to crash. · github.com, 4 Oct 2026
- Purpose
- Tape is a TAP-producing test harness for Node.js and browsers. · github.com, 9 Oct 2026
- Security
- The repository links a security policy, but the opened policy link did not show separate security or compliance claims. · github.com, 9 Oct 2026
- Security advisories
- The repository security page states that there are no published security advisories. · github.com, 4 Oct 2026
- Security reporting
- The repository security page directs vulnerability reports to maintainer @ljharb or Tidelift. · github.com, 4 Oct 2026
- Test execution
- Tests execute serially, and the command-line runner can select test files with glob patterns. · github.com, 9 Oct 2026
- Test output
- Tape writes TAP output by default and can provide an object-mode output stream. · github.com, 9 Oct 2026
- Unhandled exceptions
- By default, uncaught exceptions in tests are not intercepted and cause Tape to crash; the README suggests tape-catch to report them as TAP errors. · github.com, 9 Oct 2026
Where Tape stands on Freedom251
- Unit Testing#26 of 32
- JavaScript Testing Frameworks#19 of 23