{"id":18843,"library":"tape","title":"tape","description":"TAP-producing test harness for Node.js and browsers. Current stable version is 5.9.0, released in July 2024. Tape is a minimal, dependency-light testing library that outputs standard TAP (Test Anything Protocol) format, making it compatible with many reporters and CI systems. It supports both CommonJS and ES modules in Node.js, works in browsers via bundlers, and includes built-in async/Promise support. Unlike heavier frameworks like Jest or Mocha, tape has no global state, no configuration, and a single assert API inspired by the Node.js assert module. It is unopinionated about test organization and does not require describe/it nesting; tests are simply functions. Tape is ideal for projects that want a simple, composable, and predictable test harness with minimal setup.","status":"active","version":"5.9.0","language":"javascript","source_language":"en","source_url":"git://github.com/tape-testing/tape","tags":["javascript","tap","test","harness","assert","browser"],"install":[{"cmd":"npm install tape","lang":"bash","label":"npm"},{"cmd":"yarn add tape","lang":"bash","label":"yarn"},{"cmd":"pnpm add tape","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"tape's default export is a function. Named exports exist but are rarely used.","wrong":"import { test } from 'tape'","symbol":"test","correct":"import test from 'tape'"},{"note":"CommonJS require returns the test function directly. Destructuring will get a different export if any.","wrong":"const { test } = require('tape')","symbol":"test","correct":"const test = require('tape')"},{"note":"The Test class is a named export, available for custom assertion extensions.","wrong":"","symbol":"Test","correct":"import { Test } from 'tape'"}],"quickstart":{"code":"import test from 'tape';\n\ntest('basic arithmetic', function(t) {\n  t.plan(2);\n  t.equal(1 + 1, 2);\n  t.ok(true, 'this is true');\n});\n\ntest('async test', async function(t) {\n  t.plan(1);\n  const result = await Promise.resolve(42);\n  t.equal(result, 42, 'promise resolved correctly');\n});\n\n// Run: node test.js  (or: tape test.js)","lang":"javascript","description":"Shows synchronous and async tests with plan, assertions equal and ok."},"warnings":[{"fix":"Upgrade to Node.js >= 12, ensure CJS require pattern still works but check for any import/export changes.","message":"tape v5 dropped Node.js < 12 support and switched to ES modules internally","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Use test.skip(name, cb) instead of test(name, {skip: true}, cb)","message":"tape v4 deprecated the 'skip' option on test function in favor of test.skip()","severity":"deprecated","affected_versions":">=4.0.0 <5"},{"fix":"Always call t.plan(count) where count equals all assertions (including nested callbacks). Use t.end() if plan is hard to predict.","message":"tape's 't.plan()' must match number of assertions; mismatch causes failure at test end","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use `import test from 'tape'` (no curly braces).","cause":"Incorrect import: using named import instead of default import in ES modules.","error":"TypeError: test is not a function"},{"fix":"Ensure t.plan(N) matches the total expected assertions, or replace with t.end() for dynamic counts.","cause":"t.plan() count does not match number of assertions executed.","error":"AssertionError: plan !== count"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}