Gathering detailed insights and metrics for jest-sonar
Gathering detailed insights and metrics for jest-sonar
Gathering detailed insights and metrics for jest-sonar
Gathering detailed insights and metrics for jest-sonar
npm install jest-sonar
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
50 Stars
120 Commits
11 Forks
3 Watching
9 Branches
7 Contributors
Updated on 14 Sept 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
3.4%
30,859
Compared to previous day
Last week
2.8%
153,461
Compared to previous week
Last month
13.2%
651,467
Compared to previous month
Last year
31.5%
6,981,752
Compared to previous year
jest-sonar is a custom test reporter for Jest. It converts the generated report into Sonar's Generic Execution format.
Using yarn:
1$ yarn add -D jest-sonar
Using npm:
1$ npm i -D jest-sonar
Configure Jest in your jest.config
file and add jest-sonar
to the list of reporters.
1module.exports = { 2 ... 3 reporters: ['default', 'jest-sonar'], 4 ... 5} 6
The following options can be set to customize the reporter:
Option | Environment override | Description | Default | Accepted values |
---|---|---|---|---|
outputDirectory | JEST_SONAR_OUTPUT_DIR | The directory to which the report should be written | The projects root dir | string |
outputName | JEST_SONAR_OUTPUT_NAME | The name of the report | sonar-report.xml | string |
reportedFilePath | JEST_SONAR_REPORTED_FILE_PATH | Should the path be relative or absolute | 'relative' | 'relative' or 'absolute' |
relativeRootDir | JEST_SONAR_RELATIVE_ROOT_DIR | The root directory for the relative path | jest rootDir | string |
You can set these options when defining the reporter in jest.config
:
1module.exports = { 2 ... 3 reporters: ['default', ['jest-sonar', { 4 outputDirectory: 'my/custom/directory', 5 outputName: 'my-new-report-name.xml', 6 reportedFilePath: 'absolute' 7 }]], 8 ... 9} 10
Or you can override these options via environment variables. Environment variables will always take precedence over options set via jest.config
1$ JEST_SONAR_OUTPUT_DIR=./specialDir/ npm run jest
Contribution guidelines for this project
Contributions to this project are welcome, either by submitting bug reports, submitting feature requests or submitting pull requests.
NOTE: Be sure to merge the latest change from "upstream" before making a pull request!
This project uses the MIT license.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
Found 4/25 approved changesets -- score normalized to 1
Reason
9 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Score
Last Scanned on 2024-11-18
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