cucumber-json-merge is a utility designed for combining multiple Cucumber JSON test reports into a single, unified report. It functions as both a Node.js command-line interface (CLI) and an importable JavaScript library, primarily supporting CommonJS modules. The current stable version is 0.0.8, with recent updates indicating active maintenance, though without a strict release cadence. Its core functionality enables users to aggregate test results, which is particularly useful in CI/CD environments where tests might run in parallel or across different suites, producing fragmented reports. The package differentiates itself by offering both a direct CLI for quick usage and an API for programmatic integration into larger Node.js applications, building upon similar concepts found in `junit-merge`.
npm install cucumber-json-mergeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `cucumber-json-merge` as a library to list and merge Cucumber JSON report files programmatically. It sets up dummy report files in a temporary directory, performs the merge operation, and then cleans up.
Always review the changelog before upgrading to new versions and pin exact dependency versions in `package.json` to prevent unexpected behavior.
Ensure your project uses CommonJS for `cucumber-json-merge` imports, or consider a transpilation step if integrating into an ESM-only codebase.
Upgrade to the latest version of `cucumber-json-merge` (0.0.8 or newer) to ensure patched dependencies are used. Regularly run `npm audit`.
Run `npm install cucumber-json-merge` in your project directory, or `npm install -g cucumber-json-merge` if using the CLI globally.
Install the package globally using `npm install -g cucumber-json-merge` or ensure your shell's PATH includes the global npm binary directory.
Verify that the input JSON files are valid Cucumber reports and that the paths provided to the CLI (`-d` or direct file arguments) or library (`listJsonFiles`) are correct and accessible.
Use the `-o <filename>` option to specify an output file, e.g., `cucumber-json-merge report1.json report2.json -o merged-results.json`.
No dependency data recorded yet.