My understanding from this: Test coverage & SonarCloud
Is that sonar cloud won’t make its own coverage calculations and will just take the report file and display its values. However this is not the case for me, and even tho I exclude some files from coverage in my jest.config, sonar cloud will still display those excluded files and their coverage %. So it does calculate the coverage after all?
Hey there.
If a file isn’t mentioned in a coverage report, SonarCloud will make a very educated guess about which lines are “executable” (can be covered by tests).
And this is generally a good thing. It means that if you have a project with multiple languages (and multiple coverage tools), all files will count towards coverage even if you haven’t provided a coverage report. No code can hide.
And, that means you’ll have to mirror your exclusions in jest.config for sonar.coverage.exclusions
.
Thank you for the answer! But is there maybe an option to opt-out of that feature and have sonar cloud just take my coverage and display it as it is, no more, no less?
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.