Registry / testing / supertape

supertape

JSON →
library13.2.0jsnpmunverified

Supertape is a fast, minimal TAP-compatible test runner inspired by Tape, designed for Node.js >=22 with first-class ESM support. Current stable version is 13.2.0, released with a monthly cadence. It improves on Tape with colored diffs for equal/deepEqual, async stack traces, smart timeouts, and the ability to load CSS/JSX/DOM in tests. It deliberately excludes assertion aliases, t.plan, and t.throws (recommending tryCatch/tryToCatch instead). Ships TypeScript types and provides a built-in CLI via 'tape' command.

npm install supertape
INSTALL
IMPORT
SIG · SUPERTAPE
S
supertape
testingjavascriptv13.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

test
import test from 'supertape'
const test = require('supertape')
Default export only, named test import not available. CJS require works but ESM is recommended.
test.skip
import test from 'supertape'; test.skip('name', fn)
const test = require('supertape'); test.skip('name', fn)
test.skip is a method on the default export. Works in both ESM and CJS.
defineEnv
import { defineEnv } from 'supertape/env'
import { defineEnv } from 'supertape'
defineEnv is exported from 'supertape/env' subpath, not the main package.

Shows basic usage with synchronous and async tests, using t.equal and t.end.

import test from 'supertape'; test('addition', (t) => { t.equal(1 + 2, 3, 'should add correctly'); t.end(); }); test('async example', async (t) => { const result = await Promise.resolve(42); t.equal(result, 42, 'async works'); t.end(); });
Debug
Known issues
breakingt.throws and t.doesNotThrow are intentionally not included in supertape. Use tryCatch or tryToCatch instead.
fix
Install try-catch or try-to-catch and use tryCatch with t.equal for error checking.
affects: >=1.0.0
deprecatedt.plan() is not supported. Supertape relies on t.end() to signal test completion.
fix
Remove t.plan() and ensure each test calls t.end() or uses async/await.
affects: >=1.0.0
gotchaAssertion argument order: supertape uses result, expected (like Tape v5+), not expected, result. Many users coming from other frameworks may invert arguments.
fix
Use t.equal(actual, expected) — first argument is the actual value, second is expected.
affects: >=1.0.0
gotchaESM-only subpath imports: 'supertape/env' is only available in ESM. CJS require will fail.
fix
Use dynamic import or switch to ESM: import { defineEnv } from 'supertape/env'.
affects: >=13.0.0
breakingNode.js >=22 required as of v13. Older Node versions will not work.
fix
Upgrade Node.js to version 22 or later.
affects: >=13.0.0
Errors
Common errors & fixes
TypeError: test.only is not a function
Using test.only but imported as default from supertape; test.only is a method that exists on the default export, but if you imported a named export it won't work.
fix
import test from 'supertape', then use test.only('name', fn).
Error: Cannot find module 'supertape/env'
Using require('supertape/env') in CommonJS, but this subpath is ESM-only.
fix
Use dynamic import: await import('supertape/env') or switch to ESM module resolution.
AssertionError: expected [null] to equal [Object]
Misordering arguments in t.equal (used expected, actual instead of actual, expected).
fix
t.equal(result, expected) — first argument is actual, second is expected.
Upgrade
Version history
13.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
supertape — npm install supertape · libregistry