Zero Coverage Sensor

I used sonar scanner, but the coverage is 0%.
How can i solve this problem?
I’ve looked through various other documentation, but I can’t seem to find a clear solution.
Below is part of my project source.

lcov.info is just an empty file.

The library I used is ‘sonar-scanner - npm’.

Hey there.

Is there any coverage at all being reported on your project (not just on New Code)? Click over to the Overall Code tab to check.

Hey there.

Looking at this thread again:

You’ll need to make sure you actually generate coverage data. What tool are you using to generate code coverage after your tests run today?

Hi, Colin
I’m not sure what you mean by tool for generating code coverage.
My project langaunge is type script.

So, looking at that file, I put sonar.javascript.lcov.reportPaths as an Analysis parameter and set lcov.info.

Code Coverage doesn’t appear out of thin air. You need to use a tool that generates this file (with actual content, not just a blank file). This is what tools like instanbul are for – to actually generate a lcov.info file with information about code coverage.

1 Like