The `node-reporter-sonarqube` package provides a specialized test reporter designed for the native Node.js Test Runner, enabling seamless integration with SonarQube and SonarCloud platforms. It processes the output from Node's built-in test runner and generates a standard 'Generic Test Data' XML report (typically `test-report.xml`), which can then be consumed by SonarQube/SonarCloud for code quality analysis and metric tracking. Currently stable at version `1.0.3`, the project maintains a focused release cadence, primarily issuing updates for dependency management and minor fixes, rather than frequent new features. Its key differentiator is its direct compatibility with `node --test` command-line arguments, making it a straightforward solution for JavaScript and TypeScript projects that utilize the native Node.js testing framework and require SonarQube/SonarCloud integration for test execution reporting.
npm install node-reporter-sonarqubeVerified import paths — ran on the pinned version, not inferred.
Demonstrates installation and basic command-line usage to generate a SonarQube compatible test report using the Node.js Test Runner.
Always specify `--test-reporter-destination` immediately after its corresponding `--test-reporter`, e.g., `node --test --test-reporter=spec --test-reporter-destination=stdout --test-reporter=node-reporter-sonarqube --test-reporter-destination=test-report.xml`.
In your SonarCloud GitHub Action or Sonar Scanner CLI, ensure `-Dsonar.testExecutionReportPaths=path/to/test-report.xml` is present and accurate.
Update to `node-reporter-sonarqube` v1.0.1 or later to ensure relative paths are correctly generated in the `test-report.xml`.
Ensure `node-reporter-sonarqube` is installed as a development dependency (`npm install --save-dev node-reporter-sonarqube`) and that Node.js is run in an environment where `node_modules` is accessible.
Verify that your Node.js test command successfully generated `test-report.xml` and that the `sonar.testExecutionReportPaths` property in your SonarQube/SonarCloud configuration points to the correct location and filename.
No dependency data recorded yet.