Registry / testing / test-report

test-report

JSON →
library1.1.2jsnpmunverified

The `test-report` package is a minimalist utility designed to generate test reports, originally published over a decade ago in 2011. Currently at version 1.1.2, it has not received updates for 15 years, strongly indicating it is an abandoned project. Its primary function, inferred from its name and typical utilities from its era, is likely to consume raw test outcome data and format it into a readable string report, possibly for console output or simple file storage. Due to its age and lack of maintenance, it is exclusively CommonJS-based and does not provide native ESM support. While its simplicity might appeal for highly specific, legacy Node.js environments, its unmaintained status and the publisher's past involvement in a significant supply-chain attack (the `event-stream` incident) raise considerable concerns about security and ongoing compatibility. There is no official README, so its exact API and intended use cases must be inferred.

npm install test-report
INSTALL
IMPORT
SIG · TEST-REPORT
T
test-report
testingjavascriptv1.1.2
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

testReport
✓ const testReport = require('test-report');
✗ import testReport from 'test-report';
This package is CommonJS-only. Use `require()` for module loading.
generateReport
✓ const { generateReport } = require('test-report');
✗ import { generateReport } from 'test-report';
If the package exports specific methods, they would also be accessed via `require()` destructuring in CommonJS.
TestReport
✓ const TestReport = require('test-report'); const reporter = new TestReport();
✗ import TestReport from 'test-report'; const reporter = new TestReport();
If the package exports a constructor function, it would be instantiated after `require()`.

This quickstart demonstrates how to theoretically use `test-report` by requiring it and passing simulated test results to an assumed `generate` method to produce a formatted string output. The API is inferred due to lack of documentation.

const testReport = require('test-report'); // Simulate test results data const results = [ { name: 'User authentication', status: 'pass', duration: 120 }, { name: 'Product search functionality', status: 'fail', error: 'Expected 5 products, got 3', duration: 300 }, { name: 'Shopping cart update', status: 'pass', duration: 80 } ]; // Imagine an options object for simple customization const options = { format: 'summary', includeDurations: true }; // The actual API is inferred, this assumes a function that takes results and options // and returns a formatted string. try { const report = testReport.generate(results, options); console.log('--- Test Report ---\n'); console.log(report); console.log('\n--- End Report ---'); } catch (error) { console.error('Failed to generate report:', error.message); console.log('This package is very old and its exact API is unknown without a README.'); console.log('You might need to inspect the source code or use it differently.'); } /* Example of what `testReport.generate` might output: --- Test Report --- Test Run Summary: PASS: User authentication (120ms) FAIL: Product search functionality (300ms) - Error: Expected 5 products, got 3 PASS: Shopping cart update (80ms) Total: 3 tests, 2 passed, 1 failed --- End Report --- */
Debug
Known issues
breakingThe `test-report` package is a CommonJS-only module. Attempting to import it directly using ES Module `import` syntax in an ESM project will result in a runtime error.
fix
For ESM projects, use dynamic `import()` within an `async` function (`const testReport = await import('test-report');`) or configure your build system to transpile CommonJS modules.
affects: >=1.0.0
gotchaThis package has not been updated in 15 years (since 2011) and lacks any official README or documentation. Its API is entirely undocumented, requiring users to infer its usage from its name or inspect its source code directly. Compatibility with modern Node.js versions or testing frameworks is not guaranteed.
fix
Thoroughly review the package's source code (`node_modules/test-report`) to understand its exports and expected input/output. Consider alternatives that are actively maintained and documented.
affects: >=1.0.0
breakingThe publisher, dominictarr, was involved in the 'event-stream' supply chain attack in 2018, where a malicious dependency was introduced into a widely used package. While `test-report` itself was not implicated, relying on unmaintained packages from publishers with past security incidents carries inherent risks.
fix
Exercise extreme caution. Audit the package's source code for any unusual or potentially malicious patterns. Given its abandonment, consider migrating to a actively maintained and trusted test reporting library to mitigate security vulnerabilities and ensure long-term stability.
affects: >=1.0.0
gotchaGiven its age, `test-report` likely predates and does not integrate with modern testing frameworks (e.g., Jest, Mocha, Vitest) or their reporter interfaces. It probably expects a specific, simple input format for test results, which may not align with current standards.
fix
If using modern test runners, explore their native reporter options or use a purpose-built reporter for your framework. If attempting to integrate `test-report`, you will likely need to write an adapter to transform your test results into the format `test-report` expects.
affects: >=1.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module .../node_modules/test-report/index.js from ... not supported.
Attempting to `require()` an ES Module or using `import` for a CommonJS-only module.
fix
Ensure your project is configured for CommonJS if using `require()`. If in an ESM project, use dynamic `import()` or find an ESM-compatible alternative. This package is CommonJS-only; `import testReport from 'test-report';` will also fail.
TypeError: testReport.generate is not a function
The assumed `generate` method does not exist, or `testReport` is not an object exporting multiple functions.
fix
Without a README, the exact API is unknown. Inspect the `node_modules/test-report/index.js` file to determine what the package actually exports. It might export a single function directly (`module.exports = function(...)`) or a different object structure.
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
test-report — npm install test-report · libregistry