Grape is a JavaScript test library, inspired by and largely API-compatible with Substack's `tape`. It was created to address a specific behavior in `tape` where `t.plan()` combined with fewer assertions than planned, followed by `t.end()`, would still pass. The original README indicates this behavior was eventually fixed in `tape` itself, rendering `grape`'s primary differentiator largely obsolete. The package, currently at version 1.0.3, has not seen updates since 2017, suggesting it is no longer actively maintained. It aims to be 'swap-out-able' with `tape`, though it notes a deeper difference in that a `grape` test instance does not inherit from `EventEmitter`. Due to its age and lack of maintenance, it is primarily a CommonJS module, and its stability was described as 'whipped up in a few hours' even at its inception.
npm install grapeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates basic synchronous and asynchronous testing patterns using Grape's `tape`-like API, including `t.plan`, `t.equal`, `t.ok`, and `t.deepEqual`.
Consider migrating to `tape` (https://www.npmjs.com/package/tape) for active maintenance and broader community support. The API is highly compatible.
Avoid treating `t` (the test object) as an `EventEmitter`. If `EventEmitter` functionality is required, `tape` is the appropriate choice, or a different testing framework.
Do not use in new projects. For existing projects, plan for migration to a currently maintained testing framework to avoid potential vulnerabilities, compatibility issues, and to leverage modern JavaScript features.
Thoroughly review and test any existing codebases using `grape`. Migrate to a more stable and maintained testing framework if any unexpected behavior is encountered.
Grape is a CommonJS module. Ensure your test files or runner are configured for CommonJS (`.js` files without `"type": "module"` in `package.json`, or explicitly using `require`). If ESM is strictly required, migration to `tape` (which has better ESM compatibility, often via `--experimental-modules` or transpilation) is recommended.
Grape's test instances do not inherit from `EventEmitter`. Avoid using `EventEmitter` methods directly on the `t` object. If this functionality is crucial, migrate to `tape` which does provide `EventEmitter` capabilities on its test objects.
No dependency data recorded yet.