We are using JEST npn to generate test coverage reports and configuring it with SonarQube. We can see that there is a difference in SonarQube coverage values and JEST reports

Hi Team,

We are using JEST npn to generate test coverage reports and configuring it with SonarQube. We can see that there is a difference in SonarQube coverage values and JEST reports.
Below are the screenshots for your reference. Can you please let us know how can we compare the values of JEST and SonarQube coverage values as we can see that JEST does not produce overall coverage but Sonarqube does.
Also, please note that we have excluded the same files for coverage in JEST and Sonarqube.
JEST :

SonarQube:

image

Hi,

The Coverage % presented by SonarQube is a combination of branch and line coverage. So, the two tools are reporting different things. That probably explains most if not all of your discrepancy.

Additionally, however for (non-excluded!) files that don’t appear in your coverage report, SonarQube calculates Executable Lines and includes them in the denominator when it does the math. More details here.

 
HTH,
Ann