blue-tape is a thin wrapper around the `tape` test runner, designed to integrate promise-based asynchronous testing seamlessly. Released as version 1.0.0 approximately ten years ago, this library automatically handles returned promises from test functions, eliminating the need for explicit `t.plan()` or `t.end()` calls. It also introduces a `t.shouldFail()` assertion (aliased as `t.shouldReject`) for robustly testing promise rejections, optionally asserting on the error type or message. While it provided valuable functionality for promise-driven tests, the project is officially no longer maintained, making it an abandoned solution for modern development workflows. Developers are advised to seek actively maintained alternatives for promise support in `tape` or other testing frameworks. It primarily targets Node.js environments and uses CommonJS module syntax.
npm install blue-tapeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates basic promise-based testing, handling successful promise resolution, deliberate promise rejections causing test failures, and using `t.shouldFail` to assert on expected rejections, including custom error types.
Migrate your test suite to an alternative testing framework or a maintained `tape` wrapper with promise support.
Remove `t.plan()` and `t.end()` calls from any test functions that return a Promise. `blue-tape` manages the test's completion based on the promise's lifecycle.
Ensure your project is configured for CommonJS, or use dynamic `import()` for ESM projects (`const test = await import('blue-tape');`). The recommended fix, however, is to migrate to a modern, maintained testing library.Change your import statement to `const test = require('blue-tape');` or configure your project to use CommonJS for test files. For mixed environments, consider dynamic `import()` or migrating to a different test runner.Ensure that test functions either return the promise (allowing `blue-tape` to handle its rejection as a test failure) or explicitly catch rejections. If a rejection is expected, use `t.shouldFail(promise, expectedErrorType, message)`.