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
98
Supply Chain
100
Quality
75.2
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
69 Stars
83 Commits
43 Forks
6 Watching
3 Branches
2 Contributors
Updated on 14 Sept 2024
JavaScript (98.32%)
Shell (1.68%)
Cumulative downloads
Total Downloads
Last day
-10.6%
195,318
Compared to previous day
Last week
-1.9%
1,010,185
Compared to previous week
Last month
24.8%
4,359,958
Compared to previous month
Last year
40.8%
42,368,000
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
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
project is archived
Details
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
70 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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