Registry /
testing / codeceptjs-ctrf-json-reporter
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
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CTRFJsonReporter (via config)
✓ plugins: { ctrfJsonReporter: { require: 'codeceptjs-ctrf-json-reporter', enabled: true } }
✗ import { CTRFJsonReporter } from 'codeceptjs-ctrf-json-reporter'
The primary way to 'import' and use this reporter is through the `require` string in the CodeceptJS configuration file. Direct programmatic imports of the class are not typical for plugin usage.
CTRFJsonReporter (Class)
✓ import CTRFJsonReporter from 'codeceptjs-ctrf-json-reporter';
✗ const CTRFJsonReporter = require('codeceptjs-ctrf-json-reporter');
While not the primary usage, the reporter likely exports its main class as a default export, especially since it ships TypeScript types. This might be used for extension or advanced programmatic integration.
CTRFJsonReporterOptions (Type)
✓ import type { CTRFJsonReporterOptions } from 'codeceptjs-ctrf-json-reporter';
Given it ships TypeScript types and supports configuration options, an interface for these options is likely exported for type-checking and developer tooling. (Inferred based on common TypeScript library patterns).
This quickstart demonstrates how to install the `codeceptjs-ctrf-json-reporter` package and configure it within your CodeceptJS project. It shows how to enable the reporter and customize basic options like output file and directory, along with adding application environment details. Finally, it provides the command to run CodeceptJS tests to generate the CTRF-compliant JSON report.
npm install --save-dev codeceptjs-ctrf-json-reporter
// codecept.conf.js or codecept.conf.ts
plugins: {
ctrfJsonReporter: {
require: 'codeceptjs-ctrf-json-reporter',
enabled: true,
outputFile: 'my-ctrf-report.json', // Optional: Customize output file name
outputDir: 'reports/ctrf', // Optional: Customize output directory
appName: 'MyAwesomeApp', // Optional: Include environment info
appVersion: '1.2.3'
},
// ... other plugins ...
},
// To run your tests and generate the report
npx codeceptjs run
Debug
Known issues
gotchaThe package is currently in a pre-1.0 development phase (version `0.0.5`). APIs and features may undergo significant changes in future minor or patch releases, potentially introducing breaking changes without major version bumps until a stable 1.0 release.fixMonitor GitHub releases and changelogs for updates. Pin to specific patch versions (`~0.0.x`) if stability is critical.
affects: <1.0.0
gotchaThe reporter's configuration is managed entirely through the `plugins` section of `codeceptjs.config.js`. Attempting to import or instantiate the reporter directly in test files or other support code is not the intended usage and will not integrate it with CodeceptJS's lifecycle.
Errors
Common errors & fixes
Error: Cannot find module 'codeceptjs-ctrf-json-reporter'
The package `codeceptjs-ctrf-json-reporter` is not installed or the `require` path in `codeceptjs.config.js` is incorrect.
fixEnsure the package is installed: `npm install --save-dev codeceptjs-ctrf-json-reporter`. Verify the `require` path in your CodeceptJS configuration matches the package name exactly.
TypeError: Cannot read properties of undefined (reading 'ctrfJsonReporter')
The `plugins` configuration for `ctrfJsonReporter` is malformed or not correctly nested within the `plugins` object in `codeceptjs.config.js`.
fixDouble-check your `codeceptjs.config.js` file to ensure the `ctrfJsonReporter` entry is correctly placed within the `plugins` object and follows the expected JavaScript/TypeScript object literal syntax.
Audit
Dependencies
codeceptjsrequiredThis package is a plugin for CodeceptJS and requires CodeceptJS to be installed as a peer dependency for its functionality.