Gathering detailed insights and metrics for jest-sonar-reporter
Gathering detailed insights and metrics for jest-sonar-reporter
Gathering detailed insights and metrics for jest-sonar-reporter
Gathering detailed insights and metrics for jest-sonar-reporter
npm install jest-sonar-reporter
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (98.32%)
Shell (1.68%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
69 Stars
83 Commits
44 Forks
5 Watchers
3 Branches
2 Contributors
Updated on Sep 14, 2024
Latest Version
2.0.0
Package Id
jest-sonar-reporter@2.0.0
Size
3.83 kB
NPM Version
5.6.0
Node Version
8.9.4
Published on
Mar 25, 2018
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
jest-sonar-reporter is a custom results processor for Jest. The processor converts Jest's output into Sonar's generic test data format.
Using npm:
1$ npm i -D jest-sonar-reporter
Using yarn:
1$ yarn add -D jest-sonar-reporter
Configure Jest in your package.json
to use jest-sonar-reporter
as a custom results processor.
1{ 2 "jest": { 3 "testResultsProcessor": "jest-sonar-reporter" 4 } 5}
Configure Sonar to import the test results. Add the sonar.testExecutionReportPaths
property to your
sonar-project.properties
file.
1sonar.testExecutionReportPaths=test-report.xml
To customize the reporter you can use package.json
to store the configuration.
Create a jestSonar
entry like this:
1{ 2 "jestSonar": {} 3}
You can customize the following options:
reportPath
This will specify the path to put the report in.reportFile
This will specify the file name of the report.indent
This will specify the indentation to format the report.1{ 2 "jestSonar": { 3 "reportPath": "reports", 4 "reportFile": "test-reporter.xml", 5 "indent": 4 6 } 7}
Important: Don't forget to update
sonar.testExecutionReportPaths
when you use a custom path and file name.
Sonarqube 5.6.x does not support Generic Test Data however it has a Generic Test Coverage plugin which offers similar functionality.
If you have the plugin installed on Sonarqube, you can configure this reporter to produce files in supported format.
1{ 2 "jestSonar": { 3 "sonar56x": true 4 } 5}
Configure Sonar to import the test results. Add the sonar.genericcoverage.unitTestReportPaths
property to your
sonar-project.properties
file.
1sonar.genericcoverage.unitTestReportPaths=test-report.xml
To support different environments add the env
property to the configuration and overwrite the value of the option you want to modify for the specific environment.
You can overwrite the following configuration options: reportPath
, reportFile
, indent
, sonar56x
For example: Overwrite the path were the report will be stored.
1{ 2 "jestSonar": { 3 "reportPath": "reports", 4 "reportFile": "test-reporter.xml", 5 "indent": 4, 6 "env": { 7 "test": { 8 "reportPath": "reports-test" 9 } 10 } 11 } 12}
Use the NODE_ENV
variable to activate the environment specific configuration.
1NODE_ENV=test npm run test
Using npm:
1$ npm run test
Using yarn:
1$ yarn run test
1$ sonar-scanner
This project uses the MIT licence.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
project is archived
Details
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
72 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More