Sonar Analysis for Jasmine projects

  • versions :- * Developer Edition 9.0
  • error observed (wrap logs/code around triple quote ``` for proper formatting) Unit Test Coverage of Jasmine
  • steps to reproduce
  • potential workaround

Hi Ai m working on to include Jasmine test coverage in Sonar Qube in CI.We are using VSTS for build.

Added prepare Analysis , run analysis and publish analysis as normal steps.

Other stps areas:-image

In Npm test
image

When I ran the above build:-

It does not show any coverage on Sonar Qube:-

No Unit Test coverage.

Here is my Sonar Qube property file:-

sonar.projectKey=TableauConnector
sonar.projectName=TableauConnector
sonar.projectVersion=1.0
sonar.sources=.
sonar.exclusions=/lib/,/spec/,/iisnode/,/node_modules/,package...json,web.config,.md
sonar.tests=spec
sonar.test.inclusions=**/
.[Ss]pec.[cm]?js

Any Idea please

Hi,

LCOV is natively supported for JavaScript. Outside of that you’ll need to convert your coverage reports to the generic format.

Once you’ve got a coverage report SonarQube can read, you’ll need to update your analysis parameters to pass its location in (keys in the first link^).

 
HTH,
Ann