SonarCloud Analysis for JavaScript application

I have configured “PrepareSonarCloud Analysis” with additional parameters as
sonar.sources=src
sonar.sourceEncoding=UTF-8
sonar.tests=tests/unit
sonar.javascript.lcov.reportPaths=tests/lcov.info
sonar.javascript.coveragePlugin=cobertura
sonar.javascript.junit.reportPath=test/junit.xml
sonar.javascript.jslint.reportPath=**/*.eslintrc.js
sonar.language=js
sonar.issuesReport.html.enable=true
sonar.issuesReport.console.enable=true

I have a quick question again do we need to generate LCOV files or it generates by itself from that property because I have created an empty file manually in my “Repo” and gave that path as mentioned above. For unit test I tried with “VStest” task and “publish code coverage task with Cobertura” in my Azure pipeline. I have even tried with “Yarn test” to run my unit test but it did not support.

Are there any changes needed to be done in my code or package.json file? @Fabrice_Bellingard

Thanks!

1 Like