Tests are covered even though the sonar.test is not set

I have a javascript project and I get a code smell on test file.
According to the documentation :

By default, sonar.tests is not set

Which means, the tests are not analyzed by sonarcloud.
My tests are in tests/ folder.
In my sonar-project.properties, the sonar.tests is not set, so how can it be that I get code smell on tests?
And how can I exclude tests in this case?

  • ALM used - GitHub
  • CI system used - Circle CI

Hey there.

By default, sonar.tests is not set… so the scanner assumes that everything is a source file (sonar.sources).

Ideally, you would properly configure sonar.tests to point to your tests/ folder.

1 Like