jest-nunit-reporter is a utility package for Jest that transforms its test results into an XML format compatible with NUnit. This allows Jest test outcomes to be consumed by CI/CD systems that expect NUnit-style reports, such as Azure DevOps or Jenkins, facilitating integration into enterprise build pipelines. The current stable version is 1.3.2. This package operates as a `testResultsProcessor` within Jest's configuration, meaning it's invoked by Jest after all tests have completed to process the full test suite results. It offers configuration options for specifying output file names and paths, and for customizing test suite naming within the generated XML, providing flexibility for integration into various CI environments. Release cadence appears infrequent, primarily addressing maintenance and minor enhancements as needed, rather than rapid feature development, as its core functionality is stable.
npm install jest-nunit-reporterVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to configure Jest to use `jest-nunit-reporter` via `package.json` and generate an NUnit XML report from sample Jest tests. It includes setting the `testResultsProcessor` and specifying output paths.
Ensure the path in `jest.config.js` or `package.json` points directly to the `jest-nunit-reporter` module within `node_modules`, e.g., `./node_modules/jest-nunit-reporter`.
Add a `jestNunitReporter` object to your Jest configuration, specifying `outputPath`: `"jestNunitReporter": { "outputPath": "./test-results/", "outputFileName": "nunit.xml" }`.Consult the `jest-nunit-reporter` GitHub repository for any compatibility notes or required updates when upgrading to new major versions of Jest.
Ensure your Jest configuration correctly discovers and runs your test files (e.g., `testMatch` or `testRegex` patterns).
Verify that `jest-nunit-reporter` is installed (`npm list jest-nunit-reporter`) and that the path in `jest.config.js` or `package.json` accurately points to its location, typically `./node_modules/jest-nunit-reporter`.
Check Jest's console output for test execution errors. Ensure your `jestNunitReporter.outputPath` and `outputFileName` are correctly configured and accessible by the process. Confirm Jest actually ran tests by observing console output.
Ensure your `jest` configuration includes a valid `jestNunitReporter` object with expected properties, especially `outputPath` if you are trying to configure it, for example: `"jestNunitReporter": { "outputPath": "reports/" }`.No dependency data recorded yet.