# tape-testing/tape

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/tape-testing-tape).**

5,802 stars · 304 forks · JavaScript · mit

## Links

- GitHub: https://github.com/tape-testing/tape
- awesome-repositories: https://awesome-repositories.com/repository/tape-testing-tape.md

## Description

Tape is a TAP-producing test framework for Node.js that provides assertions, spies, subtests, and isolated test harnesses. It functions as both a test runner and an assertion library, outputting results in the Test Anything Protocol format for machine or human consumption.

The framework manages test execution through callback-based async control, plan-based auto termination, and subtest stack isolation. It includes a spy wrapper system that replaces object methods with call-recording wrappers that restore originals during teardown, along with a teardown callback registry that collects and executes cleanup functions after each test completes. Tape supports glob pattern file discovery for locating test files and module preloading hooks for transpiler setup.

The assertion library covers equality checks including deep, strict, and loose comparisons, exception assertions for verifying thrown errors, string pattern matching against regular expressions, and truthiness checks. Custom assertion creation allows user-defined validation logic, while test control features enable skipping individual assertions. The CLI provides file exclusion, focused test prevention for CI environments, and glob-based file selection.

Test lifecycle management includes explicit test completion signaling, assertion count planning, timeout enforcement, and hooks for test completion and failure events. The framework supports nested subtests that execute sequentially after parent completion, isolated harness instances with independent state, and streaming TAP output to pretty reporters.

## Tags

### Testing & Quality Assurance

- [JavaScript Test Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/javascript-test-frameworks.md) — A TAP-producing JavaScript test framework for Node.js with assertions, spies, and subtests.
- [Asynchronous Test Execution](https://awesome-repositories.com/f/testing-quality-assurance/asynchronous-test-execution.md) — Supports async test functions and callbacks for promise-based logic. ([source](https://github.com/tape-testing/tape#readme))
- [Function Call Tracking](https://awesome-repositories.com/f/testing-quality-assurance/function-call-tracking.md) — Replaces object methods with spies that record call arguments and results for test verification. ([source](https://github.com/tape-testing/tape/blob/master/readme.markdown))
- [TAP Result Exporters](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-reporters/external-result-reporters/tap-result-exporters.md) — Produces test results in the standard TAP format for compatibility with reporting tools. ([source](https://github.com/tape-testing/tape#readme))
- [Test Utilities & Assertions](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions.md) — Defines test cases with plan-based assertions and outputs TAP results. ([source](https://github.com/tape-testing/tape#readme))
- [Plan-Based Assertion Counters](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/assertion-extensions-modes/asynchronous-interaction-utilities/auto-waiting-assertions/plan-based-assertion-counters.md) — Automatically terminates tests after a planned number of assertions are executed.
- [Error Type Assertions](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/error-type-assertions.md) — Ships error type assertions that verify thrown exceptions by type, regex, or properties. ([source](https://github.com/tape-testing/tape#readme))
- [Subtest Reporters](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/subtest-reporters.md) — Groups assertions within a parent test, running them after parent completion. ([source](https://github.com/tape-testing/tape#readme))
- [Isolated Subtest Stacks](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/subtest-reporters/isolated-subtest-stacks.md) — Creates nested test contexts with independent stacks that execute after parent completion.
- [Focused Test Selectors](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-execution-controls/focused-test-selectors.md) — Provides a .only marker to restrict execution to a single test case. ([source](https://github.com/tape-testing/tape#readme))
- [Nested Subtests](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-execution-controls/nested-subtests.md) — Define and execute sub-tests within a parent test, allowing structured test suites. ([source](https://github.com/tape-testing/tape#readme))
- [Resource Teardown Registration](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-execution-controls/resource-teardown-registration.md) — Registers cleanup functions that execute in order after each test completes.
- [Teardown Hooks](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-execution-controls/teardown-hooks.md) — Registers cleanup functions that run after each test completes. ([source](https://github.com/tape-testing/tape#readme))
- [Test Skipping Mechanisms](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-execution-controls/test-skipping-mechanisms.md) — Allows marking tests as skipped so they are reported without execution. ([source](https://github.com/tape-testing/tape#readme))
- [Test Execution Timeouts](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-execution-timeouts.md) — Fails a test if it does not complete within a specified duration. ([source](https://github.com/tape-testing/tape#readme))
- [Subtest-Enabled Runners](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-runners/subtest-enabled-runners.md) — Supports nested subtests with independent assertion counts and teardown within the test runner.
- [Method Call Spies](https://awesome-repositories.com/f/testing-quality-assurance/method-call-profiling/method-call-spies.md) — Replaces object methods with spies that record call arguments and restore originals on teardown. ([source](https://github.com/tape-testing/tape#readme))
- [Node.js Test Automation](https://awesome-repositories.com/f/testing-quality-assurance/node-js-test-automation.md) — Enables Node.js unit testing with assertions, spies, and TAP output.
- [Assertion Counters](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/assertions-and-validation/assertion-validation-utilities/assertion-libraries/execution-assertions/assertion-counters.md) — Declares expected assertion counts to automatically end tests. ([source](https://github.com/tape-testing/tape#readme))
- [Value Property Assertions](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/assertions-and-validation/assertion-validation-utilities/assertion-libraries/execution-assertions/assertion-failure-handlers/value-property-assertions.md) — Compares values for strict or loose equality and reports whether they match. ([source](https://github.com/tape-testing/tape/blob/master/readme.markdown))
- [Exception Assertions](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/assertions-and-validation/assertion-validation-utilities/assertion-libraries/execution-assertions/exception-assertions.md) — Verifies that functions throw or do not throw exceptions, optionally matching the error. ([source](https://github.com/tape-testing/tape/blob/master/readme.markdown))
- [CLI Test Runners](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/execution-and-infrastructure/test-execution-runners/cli-test-runners.md) — Provides a CLI test runner that executes test files by glob patterns with configuration flags. ([source](https://github.com/tape-testing/tape#readme))
- [Test File Selection](https://awesome-repositories.com/f/testing-quality-assurance/test-file-selection.md) — Ships a CLI that selects test files using glob patterns. ([source](https://github.com/tape-testing/tape#readme))
- [Test Spying Utilities](https://awesome-repositories.com/f/testing-quality-assurance/test-spying-utilities.md) — Provides a built-in spy system that wraps functions and records call arguments and results.
- [Interaction Spies](https://awesome-repositories.com/f/testing-quality-assurance/test-spying-utilities/interaction-spies.md) — Wraps functions to record call arguments and results in a tracked array for test verification. ([source](https://github.com/tape-testing/tape/blob/master/readme.markdown))
- [Custom Assertions](https://awesome-repositories.com/f/testing-quality-assurance/custom-assertions.md) — Allows creation and invocation of user-defined assertion functions for extensible testing. ([source](https://github.com/tape-testing/tape#readme))
- [No-Throw Assertions](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/assertions-and-validation/assertion-validation-utilities/assertion-libraries/execution-assertions/exception-assertions/no-throw-assertions.md) — Verifies that functions run without throwing exceptions, with optional exception type allowances. ([source](https://github.com/tape-testing/tape#readme))
- [No-Throw Function Assertions](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/assertions-and-validation/assertion-validation-utilities/assertion-libraries/execution-assertions/exception-assertions/no-throw-function-assertions.md) — Verifies that functions run without throwing exceptions, with optional exception type allowances. ([source](https://github.com/tape-testing/tape#readme))
- [TAP Output Pipelines](https://awesome-repositories.com/f/testing-quality-assurance/test-execution-reports/tap-output-pipelines.md) — Pipes TAP output to separate modules that reformat it into colorful or machine-readable formats. ([source](https://github.com/tape-testing/tape#readme))
- [Method Interception Spies](https://awesome-repositories.com/f/testing-quality-assurance/test-spying-utilities/interaction-spies/method-interception-spies.md) — Replaces object methods with call-recording spies that restore originals during teardown.

### Part of an Awesome List

- [Manual Test Completion Signals](https://awesome-repositories.com/f/awesome-lists/devtools/end-to-end-testing/manual-test-completion-signals.md) — Provides an explicit t.end() call to signal test completion. ([source](https://github.com/tape-testing/tape#readme))

### Development Tools & Productivity

- [TAP Stream Outputs](https://awesome-repositories.com/f/development-tools-productivity/output-management-tools/stream-output-management/tap-stream-outputs.md) — Outputs test results as a machine-readable TAP stream for consumption by reporters.
- [Test Callback Controllers](https://awesome-repositories.com/f/development-tools-productivity/subcommand-registration/callback-execution-controllers/test-callback-controllers.md) — Provides callback-based async control for managing test lifecycle and completion signals.
- [Glob Pattern Selectors](https://awesome-repositories.com/f/development-tools-productivity/file-pattern-matching/regex-based-file-selection/glob-pattern-selectors.md) — Uses glob patterns to discover and select test files for execution.

### Programming Languages & Runtimes

- [Node.js Assertion Libraries](https://awesome-repositories.com/f/programming-languages-runtimes/node-js-network-libraries/node-js-assertion-libraries.md) — Provides a Node.js assertion library with deep equality, throws, and pattern matching.
- [Test Output Streams](https://awesome-repositories.com/f/programming-languages-runtimes/standard-input-output-streams/output-stream-adaptation/test-output-streams.md) — Generates readable streams of TAP output or object streams, bypassing default console output. ([source](https://github.com/tape-testing/tape#readme))

### Software Engineering & Architecture

- [Deep Equality Comparison](https://awesome-repositories.com/f/software-engineering-architecture/deep-equality-comparison.md) — Compares objects for identical structure and nested values using strict comparisons. ([source](https://github.com/tape-testing/tape#readme))
- [Test Exception Interceptors](https://awesome-repositories.com/f/software-engineering-architecture/exception-traceback-capture/process-exception-interception/test-exception-interceptors.md) — Intercepts uncaught exceptions in tests and reports them as TAP failures instead of crashing. ([source](https://github.com/tape-testing/tape#readme))
- [Test Harnesses](https://awesome-repositories.com/f/software-engineering-architecture/executable-activity-definitions/test-harnesses.md) — Ships an isolated test harness factory with independent pending stacks and test state. ([source](https://github.com/tape-testing/tape#readme))
- [TAP-Format Harnesses](https://awesome-repositories.com/f/software-engineering-architecture/executable-activity-definitions/test-harnesses/tap-format-harnesses.md) — Outputs test results in TAP format for consumption by machines or human-readable reporters.
- [Loose Deep Equality Comparisons](https://awesome-repositories.com/f/software-engineering-architecture/deep-equality-comparison/loose-deep-equality-comparisons.md) — Compares nested objects using loose equality on leaf values for structural matching. ([source](https://github.com/tape-testing/tape#readme))
- [Loose Equality Assertions](https://awesome-repositories.com/f/software-engineering-architecture/execution-control/equality-validators/equality-operators/loose-equality-assertions.md) — Verifies loose equality between values using the double-equals operator. ([source](https://github.com/tape-testing/tape#readme))
- [Strict Equality Assertions](https://awesome-repositories.com/f/software-engineering-architecture/execution-control/equality-validators/equality-operators/strict-equality-assertions.md) — Verifies strict equality between values using Object.is comparison. ([source](https://github.com/tape-testing/tape#readme))
- [Property Access Spies](https://awesome-repositories.com/f/software-engineering-architecture/property-interception-middleware/property-access-spies.md) — Replaces object properties to log get and set operations, restoring originals during teardown. ([source](https://github.com/tape-testing/tape#readme))

### System Administration & Monitoring

- [Test State Cleanup](https://awesome-repositories.com/f/system-administration-monitoring/execution-callbacks/cleanup-callbacks/test-state-cleanup.md) — Registers callbacks to undo side effects after each test finishes. ([source](https://github.com/tape-testing/tape/blob/master/readme.markdown))

### Web Development

- [Exception Handling](https://awesome-repositories.com/f/web-development/exception-handling.md) — Intercepts uncaught exceptions in tests and reports them as TAP errors instead of crashing. ([source](https://github.com/tape-testing/tape#readme))
