tape: TAP output from a deliberately small test core
tap-producing test harness for node and browsers
At a glance
- What is it?
- tape is a TAP-producing test harness for node and browsers whose core stops at assertions. Output formatting, describe blocks, concurrency and exception handling all live in separate packages.
- Who is it for?
- tape fits when the TAP stream itself is the deliverable: another process, a CI parser, a custom reporter, or a runtime the core never claimed to cover. It fits badly when a team expects a runner to absorb detail, because an uncaught exception still kills the process, suites still need tape-describe, parallel runs still need mixed-tape, and readable output still needs something on the end of the pipe.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 8 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- tape-testing/tape5,797 ★ · +0
| Repository | 2026-09-23 | 2026-11-15 |
|---|---|---|
| tape-testing/tape | 5.8k | 5.8k |
0 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
tape hands its arguments to glob, and --strict makes an empty match an error
Install the package and write a test file that requires it. There is no setup file, no registry and no configuration object.
$ npm install tapevar test = require('tape');
test('timing test', function (t) {
t.plan(2);
t.equal(typeof Date.now, 'function');
var start = Date.now();
setTimeout(function () {
t.equal(Date.now() - start, 100);
}, 100);
});That file runs two ways: `node test-file.js` from a shell, or `require('test-file.js')` from another module. A third entry is the `tape` binary that package.json points at ./bin/tape, and its arguments are handed to the glob module rather than to node.
$ tape 'tests/**/*.js'
$ tape --strict 'tests/**/*.js'Quote the pattern so glob does the expansion on a system where the shell would expand it first. Without --strict an empty match is not an error, and that is the failure mode worth knowing about: rename a directory and the run stays green having executed nothing.
tape loads every preload before any test, and resolves it the way node does
The -r flag, aliased --require, loads modules before the first test runs. The documented example pulls in babel-register so test files can be compiled on the fly.
$ tape -r babel-register tests/**/*.jsIt behaves exactly like node's require, including the resolution algorithm, so a local module has to be written as a path with ./ or ../ in front.
$ tape -r ./my/local/module tests/**/*.jsOrdering is the sharp edge. Modules named with -r all run before any test regardless of where they sit on the command line, so `tape -r a b -r c` loads a and c before b. Two preloads that depend on each other will not see the order you typed, and nothing in the flag tells you which preload failed first. Configuration for the preloaded module stays outside tape: Babel reads its own .babelrc at runtime, which is why the example needs no options on the command line.
An uncaught exception kills the run instead of failing one test
The sharpest limit in the design sits here: uncaught exceptions in a test are not intercepted, and they crash the harness. The documented remedy is a separate package, tape-catch, which reports those exceptions as TAP errors. tape itself has no flag that turns the behaviour on, and no built-in fault boundary around a test function.
The consequence shows up in any file that schedules work and forgets to guard it. A throw inside a setTimeout callback or a promise rejection with no handler ends the process, taking with it the tests that had not run yet and the diagnostics for the ones that had. A runner that isolates each test makes that a single failure line in the stream; here it is a non-zero exit and a stack trace.
The core stops at assertions, so output and structure come from other packages
Run a test file the way the documentation does, and the result is a stream of TAP lines with no colour. That is deliberate. Formatting happens by piping into another module.
$ node test/index.js | tap-specThe reporter list runs past twenty packages, among them tap-spec, tap-dot, faucet, tap-min, tap-json, tap-nyan, colortape, tap-html, tap-junit and tap-nyc, and each one is a separate dependency with its own release cycle. The same split applies to test structure: describe blocks from tape-describe, concurrency from mixed-tape, in-process reporting from tape-player, a CoffeeScript syntax from coffeetape, ES6 through babel-tape-runner or buble-tape-runner, an Electron runner from electron-tap, and a different assertion style from flip-tape, which the documentation warns mutates String.prototype.
Only three flags reach the binary, and they all filter files
Top-level behaviour is set from the command line, and the documentation lists four configurations in total. The -i flag, aliased --ignore, takes a path to a file of ignore patterns. Passed with no argument at all it falls back to .gitignore.
$ tape -i .ignore '**/*.js'If the named file does not exist the run errors out rather than starting with everything included. The companion --ignore-pattern takes the pattern directly instead of reading a file, and when both flags are present its argument is appended to the content of the ignore file rather than replacing it, so a one-off exclusion can be added without editing that file.
$ tape --ignore-pattern 'integration_tests/**/*.js' '**/*.js'The remaining flag guards a specific CI accident. Any test left as an only test passes on a developer machine and hides its neighbours, so --no-only turns its presence into a failure.
$ tape --no-only **/*.jsSetting NODE_TAPE_NO_ONLY_TEST to true has the same effect, and the flag wins when both are present. Beyond those four, the binary keeps its own configuration to a minimum.
Version 5.10.2, four lib entry points, and a browser field that blanks fs
package.json shows the shape of the package. The main entry is index.js, and the exports map opens four subpaths: ./lib/default_stream, ./lib/results, ./lib/test and ./package.json. The bin field points at ./bin/tape, sideEffects is false, and the browser field maps fs to false, which is the one line that lets the harness build where there is no filesystem. Type definitions ship in index.d.ts and the types/ directory, next to tsconfig.json and eslint.config.mjs, with coverage settings in .nycrc.
Versioning happens through npm only. package.json reads 5.10.3 and CHANGELOG.md sits at the top level, and the repository publishes no releases, so a version history has to come from that changelog file or the registry rather than from tagged releases. The last commit on the default branch, master, landed on 2026-10-29, and the repository is not archived.
The example/ directory explains the design better than the prose does. It holds array.js, fail.js, nested.js, nested_fail.js, no_callback.js, not_enough_fail.js, throw_fail.js, too_many_fail.js and two.js, plus static/ and stream/ subdirectories. Those names are the catalogue of ways a run goes wrong: a plan with fewer assertions than declared, one with more, a throw inside a test, a test that never calls back. Even the timing example used to open the documentation is a flaky assertion, comparing elapsed time to exactly 100 milliseconds and printing 107.
Editorial conclusion
tape fits when the TAP stream itself is the deliverable: another process, a CI parser, a custom reporter, or a runtime the core never claimed to cover. It fits badly when a team expects a runner to absorb detail, because an uncaught exception still kills the process, suites still need tape-describe, parallel runs still need mixed-tape, and readable output still needs something on the end of the pipe. Check first whether the extra packages you would add are ones you intend to keep updated, because the core is version 5.10.3 with a changelog file and no tagged releases behind it. The cheapest way to decide is to run one existing test file under node and read the output without a reporter attached.
Frequently asked questions
Does tape intercept uncaught exceptions thrown inside a test?
No. Uncaught exceptions in your tests are not intercepted and will crash the harness. The documented remedy is the tape-catch package, which reports those exceptions as TAP errors, and tape itself has no flag for the behaviour.
How do I get readable output from tape instead of raw TAP?
Pipe the stream into a reporter module. The documentation gives node test/index.js | tap-spec, and lists more than twenty reporters including faucet, tap-dot, tap-json, tap-html and tap-junit.
What does the tape --require flag do with argument order?
Every module named with -r loads before any test, so tape -r a b -r c loads a and c before b. It behaves like node's require, so local modules need a ./ or ../ prefix on the path.
Why does a tape run stay green when no test files match the pattern?
The arguments go to the glob module, and an empty match is not an error by default. Pass --strict to make tape error when no files are found.
Can tape run test suites in parallel or group tests with describe?
Not from the core. Concurrency comes from mixed-tape, describe blocks from tape-describe, and in-process reporting from tape-player, so each capability is a separate package to install and update.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/tape-testing-tape)Star history chart for your README
[](https://hysenlabs.com/projects/tape-testing-tape)Was this useful?