I have a project to analyze which is only based on Angular framework. The main issue I have is that both source and test files are on the same directories, divided into features.
Here is an example of my structure:
+- client
| +- features
| | +- home
| | | +- home.js [source code]
| | +- home.spec.js [test code]
| +- home.html
| +- home.less
+- admin
| +- admin.js [source code]
| +- admin.spec.js [test code]
| +- admin.html
| +- admin.less
...
In my sonar-project.properties
, it seems impossible to set a pattern instead of a path (for ex. sonar.tests=client/**/*.spec.js
).
Is there a way to run an analysis with this kind of structure?
Thanks.
I have a project to analyze which is only based on Angular framework. The main issue I have is that both source and test files are on the same directories, divided into features.
Here is an example of my structure:
+- client
| +- features
| | +- home
| | | +- home.js [source code]
| | +- home.spec.js [test code]
| +- home.html
| +- home.less
+- admin
| +- admin.js [source code]
| +- admin.spec.js [test code]
| +- admin.html
| +- admin.less
...
In my sonar-project.properties
, it seems impossible to set a pattern instead of a path (for ex. sonar.tests=client/**/*.spec.js
).
Is there a way to run an analysis with this kind of structure?
Thanks.
Share Improve this question asked Mar 17, 2015 at 14:08 Romain LinsolasRomain Linsolas 81.7k52 gold badges205 silver badges276 bronze badges1 Answer
Reset to default 11Thanks to SonarQube mailing list, the solution is to set the following properties:
sonar.sources=client
sonar.tests=client
sonar.exclusions=**/*.spec.js
sonar.test.inclusions=**/*.spec.js