{"id":14494,"library":"codeceptjs-ctrf-json-reporter","title":"CodeceptJS CTRF JSON Reporter","description":"The `codeceptjs-ctrf-json-reporter` is a CodeceptJS plugin designed to save test results as a JSON file, strictly adhering to the Common Test Report Format (CTRF) standard. Currently at version `0.0.5`, this package aims to provide a consistent and universal reporting schema for CodeceptJS users, facilitating easier analysis and comparison of test outcomes across diverse testing tools and programming languages. While a specific release cadence is not yet established given its pre-1.0 status, it integrates seamlessly into CodeceptJS configurations. Its key differentiator is its commitment to the open-source CTRF specification, ensuring uniformity in test reports, which is crucial for modern CI/CD pipelines and cross-platform testing environments, offering a standardized approach where other tools often produce varied formats.","status":"active","version":"0.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/ctrf-io/codeceptjs-ctrf-json-reporter","tags":["javascript","typescript"],"install":[{"cmd":"npm install codeceptjs-ctrf-json-reporter","lang":"bash","label":"npm"},{"cmd":"yarn add codeceptjs-ctrf-json-reporter","lang":"bash","label":"yarn"},{"cmd":"pnpm add codeceptjs-ctrf-json-reporter","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is a plugin for CodeceptJS and requires CodeceptJS to be installed as a peer dependency for its functionality.","package":"codeceptjs","optional":false}],"imports":[{"note":"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.","wrong":"import { CTRFJsonReporter } from 'codeceptjs-ctrf-json-reporter'","symbol":"CTRFJsonReporter (via config)","correct":"plugins: { ctrfJsonReporter: { require: 'codeceptjs-ctrf-json-reporter', enabled: true } }"},{"note":"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.","wrong":"const CTRFJsonReporter = require('codeceptjs-ctrf-json-reporter');","symbol":"CTRFJsonReporter (Class)","correct":"import CTRFJsonReporter from 'codeceptjs-ctrf-json-reporter';"},{"note":"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).","symbol":"CTRFJsonReporterOptions (Type)","correct":"import type { CTRFJsonReporterOptions } from 'codeceptjs-ctrf-json-reporter';"}],"quickstart":{"code":"npm install --save-dev codeceptjs-ctrf-json-reporter\n\n// codecept.conf.js or codecept.conf.ts\nplugins: {\n  ctrfJsonReporter: {\n    require: 'codeceptjs-ctrf-json-reporter',\n    enabled: true,\n    outputFile: 'my-ctrf-report.json', // Optional: Customize output file name\n    outputDir: 'reports/ctrf',       // Optional: Customize output directory\n    appName: 'MyAwesomeApp',           // Optional: Include environment info\n    appVersion: '1.2.3'\n  },\n    // ... other plugins ...\n},\n\n// To run your tests and generate the report\nnpx codeceptjs run\n","lang":"typescript","description":"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."},"warnings":[{"fix":"Monitor GitHub releases and changelogs for updates. Pin to specific patch versions (`~0.0.x`) if stability is critical.","message":"The 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.","severity":"gotcha","affected_versions":"<1.0.0"},{"message":"The 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.","severity":"gotcha"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure 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.","cause":"The package `codeceptjs-ctrf-json-reporter` is not installed or the `require` path in `codeceptjs.config.js` is incorrect.","error":"Error: Cannot find module 'codeceptjs-ctrf-json-reporter'"},{"fix":"Double-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.","cause":"The `plugins` configuration for `ctrfJsonReporter` is malformed or not correctly nested within the `plugins` object in `codeceptjs.config.js`.","error":"TypeError: Cannot read properties of undefined (reading 'ctrfJsonReporter')"}],"ecosystem":"npm"}