Our team writes JavaScript unit tests using Jasmine. We are setting up codebase analysis in SonarQube. The SonarQube JavaScript plugin documentation says that it will use unit test results only in the format that is generated by JS Test Driver. I'm using Karma already for generating the LCOV report but to my surprise I can't find a reporter that generate the collection of TEST-*.xml files that JS Test Driver generates. Please advise.
Asked
Active
Viewed 363 times
2 Answers
1
I just wrote an open source SonarQube plugin to take the output of the karma-junit-reporter plugin and allow its output to be populated into SonarQube. You can find it in the here: https://github.com/acwatson/sonar-karma-test-report-plugin

Anthony Watson
- 11
- 2
0
@SBel - This is something that even I am attempting to do. I have read a few articles and yes there is a plugin for Karma which generates these Test-*.xml files. The karma plugin is documented here https://github.com/karma-runner/karma-junit-reporter.
Looks like there has been a little history linked to this Sonar feature. This capability was removed and re-added recently in version 2.2 of the java script plugin.
I found these links to be useful. Links 1 & 2 should answer your question.

Community
- 1
- 1

chirag kalyanpur
- 122
- 1
- 10