Code coverage for Javascript Unit Tests is not shown in SonarQube for .NET solution containing multiple C# projects

I am using a .NET solution consisting of multiple C# projects. I am using Karma test runner with QUnit to unit test JavaScript & I have added the files in a C# class library in this .NET solution.

I am using TeamCity to execute the unit tests & get the code coverage of C# & JavaScript unit tests in SonarQube ver 7.9 for this .NET solution.

The Karma test runner creates the coverage folder containing the lcov.info file before starting the Sonar Scanner. I have mentioned
sonar.javascript.lcov.reportPaths={WorkingDirectory}/{projectPath}/coverage/lcov.info while running the Sonar Scanner.

The path mentioned in sonar.javascript.lcov.reportPaths is correct, but the code coverage for Javascript unit tests is not shown. Only code coverage for C# unit tests is shown.

Please let me know why the code coverage for JavaScript unit tests is not shown in SonarQube.

Hi @VivekG,

would it be possible to share with us the verbose logs of the end step?

please run SonarScanner.MSBuild.exe begin /k:“MyProject” /d:sonar.verbose=true as the begin step, and please attach the output of the BEGIN and END steps.

Thanks,
Costin

SonarJS ver 5.2.1.7778 plugin is being used in SonarQube ver 7.9.4

I have already added the JavaScript files in the C# class library.

I am getting the following errors related to SonarJS:

‘SonarJS’ skipped because there is no related file in current project

‘ESLint-based SonarJS’ skipped because there is no related file in current project

‘SonarJS Coverage’ skipped because there is no related file in current project

Please let me know why these SonarJS errors are shown.

Hello @VivekG

As Costin already mentioned we cannot triage the issue any further without the logs.
Could you please forward the verbose logs to us?

All the best,
Čaba