The `cucumber-junit-convert` package is a utility designed to transform JSON output files generated by Cucumber.js into the standard JUnit XML format, widely used for continuous integration reporting. Currently at version 2.1.1, the library's key distinguishing feature is its mapping strategy: it treats each Cucumber 'Scenario' as a JUnit 'Testcase', rather than the more granular 'Step' level often used by similar tools. This approach provides a clearer, higher-level overview in test reports. While not on a strict rapid release cycle, the package has received consistent updates, including recent bug fixes and feature additions like support for embeddings and the option to use feature names as JUnit class names, indicating active maintenance. It is particularly useful for projects integrating Cucumber.js tests with CI/CD pipelines that expect JUnit XML reports.
npm install cucumber-junit-convertVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to convert a Cucumber.js JSON result file into a JUnit XML report, including a basic example of creating the input JSON and configuring conversion options.
Ensure the `inputJsonFile` option points to an existing and accessible Cucumber.js JSON report file.
If you need to preserve existing JUnit XML reports, ensure your build process moves or renames them before running the conversion, or specify a unique output file name.
For consistent reporting, upgrade to v2.1.0 or newer and set `featureNameAsClassName: true` in your options if you desire this mapping.
Verify that the path provided for `inputJsonFile` is correct, the file exists, and your application has read permissions for it.
For CommonJS, use `const cucumberJunitConvert = require('cucumber-junit-convert'); cucumberJunitConvert.convert(options);`. For ESM, use `import { convert } from 'cucumber-junit-convert'; convert(options);`.No dependency data recorded yet.