Registry / testing / jest-ctrf-json-reporter

jest-ctrf-json-reporter

JSON →
library0.0.11jsnpmunverified

The `jest-ctrf-json-reporter` package provides a Jest test reporter designed to generate JSON test reports that strictly adhere to the Common Test Report Format (CTRF) standard. Currently stable at version `0.0.11`, the package sees active development with frequent, minor updates addressing dependency bumps and feature enhancements, though it remains in the `0.x.x` release series, indicating potential for breaking changes prior to a `1.0.0` release. Its primary differentiator is its commitment to the CTRF open standard, which aims to standardize JSON test report schemas across various programming languages and testing frameworks. This standardization enables consistent parsing, validation, merging, and analysis of test outcomes, regardless of the underlying testing tool, thereby facilitating more robust CI/CD pipelines and cross-platform reporting solutions. This reporter is a crucial component for projects seeking universal and machine-readable test results.

npm install jest-ctrf-json-reporter
INSTALL
IMPORT
SIG · JEST-CTRF-JSON-REP
J
jest-ctrf-json-reporter
testingjavascriptv0.0.11
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.

'jest-ctrf-json-reporter'
reporters: [ 'default', ['jest-ctrf-json-reporter', {}], ],
import { JestCtrfJsonReporter } from 'jest-ctrf-json-reporter';
This package is a Jest reporter plugin; it is configured via the 'reporters' array in jest.config.js, not imported directly into application code using standard JavaScript import/require statements.

Demonstrates how to install the reporter, configure it in `jest.config.js` with common options, and execute Jest tests to generate a CTRF-compliant JSON report.

npm install --save-dev jest-ctrf-json-reporter // jest.config.js module.exports = { reporters: [ 'default', ['jest-ctrf-json-reporter', { outputFile: 'my-project-report.json', // Optional: Custom output file name outputDir: 'test-results/ctrf', // Optional: Custom output directory testType: 'e2e', // Optional: Specify the test type appName: 'MyAwesomeApp', // Optional: Name of the application appVersion: '1.2.3' // Optional: Version of the application }], ], }; // Run your tests npx jest
Debug
Known issues
breakingSince the package is in its `0.x.x` version series, breaking changes may be introduced without adhering strictly to semantic versioning's major version bumps (e.g., `1.0.0`). Developers should review release notes carefully when upgrading.
fix
Consult the GitHub release notes and changelog before upgrading and perform thorough regression testing.
affects: <1.0.0
gotchaBy default, the reporter outputs `ctrf-report.json` to a `ctrf` directory. If this default path conflicts with existing assets or is not expected, users might struggle to locate reports or inadvertently overwrite files.
fix
Explicitly configure `outputFile` and `outputDir` options in `jest.config.js` to control the report location and name, ensuring they align with your project's structure.
affects: >=0.0.1
gotchaThe `minimal: true` option is designed to generate a stripped-down report and will override other detailed report properties, such as `screenshot` and `testType`, even if those options are explicitly set.
fix
Understand the implications of `minimal: true` and only use it when a less comprehensive report is intentionally desired. Avoid setting `minimal: true` if detailed information like `testType` or `screenshot` paths are required.
affects: >=0.0.10
Errors
Common errors & fixes
Error: Reporter 'jest-ctrf-json-reporter' not found.
The package was not installed, or there is a typo in the reporter name within the Jest configuration.
fix
Run `npm install --save-dev jest-ctrf-json-reporter` and double-check the reporter string `'jest-ctrf-json-reporter'` in your `jest.config.js` file.
No `ctrf-report.json` file generated in the expected directory.
Jest tests either did not run, failed to complete successfully, or the `outputDir` and `outputFile` options are misconfigured or pointing to an inaccessible location.
fix
Ensure your Jest tests are executing and completing without errors. Verify the `outputDir` and `outputFile` settings in `jest.config.js`, confirming the specified paths are valid and writable by the process running Jest.
Upgrade
Version history
0.0.11latest on npm
Audit
Dependencies
jestrequiredRuntime dependency for Jest test reporting integration.
Agent activity
6 hits · last 30 days
node
6
Resources
jest-ctrf-json-reporter — npm install jest-ctrf-json-reporter · libregistry