Registry / testing / cleaner-spec-reporter

cleaner-spec-reporter

JSON →
library1.0.3jsnpmunverified

cleaner-spec-reporter is a test reporter for Node.js's native test runner, providing a more refined and visually clean output compared to the default 'spec' reporter. It is designed to integrate seamlessly with the `node --test` command-line interface. The package is currently stable at version 1.0.3, with recent releases focusing on type import sanitization and minor fixes. A significant breaking change occurred in version 1.0.0, which dropped support for Node.js 20, now requiring Node.js 22.21.0 or higher. This library is ESM-only for direct programmatic imports. Its primary differentiator is its focus on enhancing the readability of test results in the terminal through improved formatting and coloring, aiming to streamline the developer experience during testing and CI workflows.

npm install cleaner-spec-reporter
INSTALL
IMPORT
SIG · CLEANER-SPEC-REPOR
C
cleaner-spec-reporter
testingjavascriptv1.0.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CleanerSpecReporter
import { CleanerSpecReporter } from 'cleaner-spec-reporter';
const CleanerSpecReporter = require('cleaner-spec-reporter');
This package is ESM-only. The main reporter class is a named export. Direct programmatic import is typically for custom test runner integrations or extensions, as the primary use is via the `node --test` CLI flag.
ReporterOptions
import type { ReporterOptions } from 'cleaner-spec-reporter';
Type-only import for defining reporter options, useful when creating custom reporter wrappers or adhering to the reporter interface programmatically.

Demonstrates setting up cleaner-spec-reporter as the default test reporter in your `package.json` for Node.js's native test runner.

{ "name": "my-project", "version": "1.0.0", "type": "module", "scripts": { "test": "node --test --test-reporter=cleaner-spec-reporter" } } // Add a simple test file (e.g., test/example.test.js) // import { test, mock } from 'node:test'; // import assert from 'node:assert'; // // test('synchronous passing test', () => { // assert.strictEqual(1, 1); // }); // // test('passing test with async/await', async () => { // await new Promise(resolve => setTimeout(resolve, 10)); // assert.ok(true); // }); // // test('failing test', () => { // assert.deepStrictEqual({ a: 1 }, { a: 2 }); // }); console.log('To run tests, make sure you have a package.json with the above script and test files in a "test" directory.'); console.log('Then run: npm test');
Debug
Known issues
breakingVersion 1.0.0 dropped support for Node.js 20. Users must upgrade their Node.js environment to version 22.21.0 or higher to use this package.
fix
Upgrade your Node.js runtime to version 22.21.0 or newer. Consider using a Node.js version manager like `nvm` or `volta` to manage multiple Node.js versions.
affects: >=1.0.0
gotchaThis package is explicitly designed as an ESM-only module. Attempting to `require()` it in a CommonJS context will result in an error.
fix
Ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json`) if you plan to import it programmatically. For CLI usage, simply ensure Node.js is configured to run your tests in an ESM context if your test files are ESM.
affects: >=0.5.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: Must use import to load ES Module:
Attempting to import cleaner-spec-reporter using `require()` in a CommonJS module.
fix
Convert your consuming module to ES Module format (e.g., add `"type": "module"` to `package.json` and use `import`) or ensure you are only using the package via the Node.js CLI `--test-reporter` flag in an ESM-compatible test setup.
Test reporter "cleaner-spec-reporter" is not a valid module.
This error often indicates that the Node.js version being used is older than the minimum required version (v22.21.0) or there's an issue with module resolution or package installation.
fix
Verify your Node.js version is 22.21.0 or newer. Reinstall the package (`npm install cleaner-spec-reporter`) to ensure integrity. Check your project's `package.json` for `"type": "module"` if your test files are ESM.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
2
Resources
cleaner-spec-reporter — npm install cleaner-spec-reporter · libregistry