Help ignoring test files from coverage

Hi! been trying for couple of days to ignore the test files for my coverage metric but can’t figure it out. I’ve tried the following:

but the coverage still shows 37% because it takes test files into account. This is what I currently have on master but still to no avail: maffin-app/.github/workflows/frontend-ci.yml at master · maffin-io/maffin-app · GitHub

any ideas on how to fix this? This is the project overview SonarCloud

Thanks in advance!

Hey there.

I would suggest this as your coverage exclusion:

**/__tests__/**

However, we would normally recommend that test files get indexed as test files.

What this would mean in practice is defining both sonar.sources and sonar.tests as src and then configuring sonar.test.inclusions to **/__tests__/**

ahhh tried the last suggestion and that fixed it. In previous attempts I was trying to set sonar.tests=src/__tests__ and was having an error about double indexing files.

Thanks a lot!