Question

I am kinda newbie in using Sonar and plugins for javascript code coverage.

  1. Which are the possibilities to find out the quality (including code coverage) of javascript code when analyzed with Sonar?

  2. Currently I am using karma runner which delivers a code coverage report. Is it possible to use it in Sonar?

Thanks.

No correct solution

OTHER TIPS

The following discussion covers setting up SonarQube for a javascript project: https://community.sonarsource.com/t/sonarcloud-analysis-for-javascript-application/10591/3

I just went through the process for the first time. The key is getting the lcov.info file, which Elena mentioned can be produced by Karma. The following setting causes the coverage info to be published to your SonarQube project:

sonar.javascript.lcov.reportPaths=coverage/lcov.info

Note the path is relative to the project root.

  1. Check documentation https://docs.sonarqube.org/display/PLUG/SonarJS (part "Code Coverage")
  2. It's seems that it's possible to use Karma with SQ (as it can produce lcov format)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top