I'm having hard time to understand why SonarQube has different coverage results compared to Jest coverage.
My question is, why does the coverage deviate with a noticeable amount and how can you prevent this in the future.
CodePudding user response:
If you're talking about, for instance, the values of "82.4%" and "81.25%" (I think that's it, it's too small) for config.provider.ts, that's because SonarQube code coverage is actually a "weighted average" of multiple metrics.
Look at the details in this thread for the algorithm: https://community.sonarsource.com/t/sonarqube-and-code-coverage/4725