Registry / testing / tap-difflet

tap-difflet

JSON →
library0.7.2jsnpmunverified

TAP output formatter that uses difflet to provide visual diffing for inequality errors. Version 0.7.2 is the latest stable release. The package has been in maintenance mode since around 2015 with no recent updates. It is CLI tool that pipes TAP output from test runners like tape or mocha and formats results with colored diffs. Supports options like pessimistic mode to show only failures. Unlike other TAP reporters, it focuses on providing clear visual diffs for failing assertions.

npm install tap-difflet
INSTALL
IMPORT
SIG · TAP-DIFFLET
T
tap-difflet
testingjavascriptv0.7.2
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.

tapDifflet
const tapDifflet = require('tap-difflet');
import tapDifflet from 'tap-difflet';
Package uses CommonJS and does not support ESM. TypeScript may need @types/tap-difflet.

Demonstrates CLI usage with tape and programmatic usage inside Node.js code.

# Install globally for CLI usage npm install -g tap-difflet # Run tests with tape and pipe to tap-difflet tape test/*.js | tap-difflet # Only show failed tests tape test/*.js | tap-difflet -p # Programmatic usage in Node.js const tapDifflet = require('tap-difflet'); const formatter = tapDifflet({ pessimistic: false }); process.stdin.pipe(formatter).pipe(process.stdout);
Debug
Known issues
deprecatedPackage is no longer actively maintained. Last release was in 2015.
fix
Consider alternatives like tap-spec or faucet.
affects: >=0.0.0
gotchaOnly works with TAP-producing test runners like tape, not with mocha's default reporter.
fix
Use tape, node-tap, or configure mocha to output TAP.
affects: >=0.0.0
gotchaOutputs to stdout by default; error output goes to stderr but may not be shown.
fix
To capture all output, redirect stderr: `tape test/*.js | tap-difflet 2>&1`
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'tap-difflet'
Package not installed or not in node_modules.
fix
Run `npm install tap-difflet --save-dev` or `npm install -g tap-difflet`.
TypeError: tapDifflet is not a function
Using ES import syntax on a CommonJS module without default import interop.
fix
Use `const tapDifflet = require('tap-difflet');` instead of `import tapDifflet from 'tap-difflet';`
** 2 failing
tap-difflet only shows summary for tests it doesn't understand.
fix
Ensure your test runner outputs valid TAP format. Use `tape` or `node-tap`.
Upgrade
Version history
0.7.2latest on npm
Audit
Dependencies
diffletrequiredUsed to generate colorful diffs for inequality errors
duplexerrequiredUsed to create a stream that writes to both stdout and stderr
tap-format-taprequiredParses TAP output from stdin
Agent activity
8 hits · last 30 days
node
6
Amazon
1
Resources
tap-difflet — npm install tap-difflet · libregistry