JSPM

jest-to-sonar

1.3.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1713
  • Score
    100M100P100Q116190F
  • License ISC

Convert the Jest test case report to a Sonar generic test execution report.

Package Exports

  • jest-to-sonar
  • jest-to-sonar/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jest-to-sonar) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jest-to-sonar

Quality Gate StatusGithub action workflow statusCodeQLnjsscan AnalysisMaintainabilityTest Coverage

Convert the Jest test case report to a Sonar generic test execution report.

Installation

  • Using yarn:

    yarn add -D jest-to-sonar
  • Using npm:

    npm i -D jest-to-sonar

Configuration

Configure the jest config file jest.config.js, by adding jest-to-sonar to the list of reporters. Once you successfully run the jest test command, a Sonar generic test execution report will be created at ./coverage/sonar-report.xml.

module.exports = {
    ...
    reporters: ['default',  'jest-to-sonar'],
    ...
}

We can customize the file name and path for the generated Sonar generic test execution report by passing parameters to outputFile in jest config.

module.exports = {
    ...
        reporters: ['default',  ['jest-to-sonar', {
            outputFile: './coverage/sonar-report.xml',
        }]],
    ...
}

Available Options

Parameter Name Description Default Value Type
outputFile Report file name with or without folder path ./coverage/sonar-report.xml String
... ... ... ...

Contribution

You can help this project by reporting bugs, asking for features, or sending in pull requests.


Connect with me on