I am using Sonar in a Angular Application for the front part.
I have many js files in my application, but i need that the Sonar ignore or exclusion my js files that ending in .spec.js, are tests unit of Angular.
I have many folders under "src/app" and inside i have many folders with the .spec.js files .
In the properties file to Sonar (sonar-project.properties), I think I can use:
sonar.test.exclusions=src/app/*.spec.js
or
sonar.exclusions=src/app/*.spec.js
But I'm not sure, in what format is the value of property.
Thanks,
Yes, you are correct. You can use the sonar.exclusions property to exclude source files from analysis and the sonar.test.exclusions property to exclude unit tests. You should pass a comma-delimited list of file path patterns to these properties.
I suggest you refer to this topic to learn how to specify path patterns. Say, if you need to exclude all the .spec.js files from all the src/app directories, use this pattern:
**/src/app/*.spec.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With