We are setting up TeamCity to run our jasmine tests using node and karma.
The tests run fine and results are reported under the "Tests" tab in TeamCity.
However we would like to report code coverage in TeamCity (and even set Build Failure Conditions on the level).
I have installed the karma-coverage module
npm install karma-coverage --save-dev
And tried to configure it in karma.conf.js
by adding
preprocessors: {
'myProject/Scripts/app/**/*.js': 'coverage'
},
reporters: ['progress', 'coverage'],
When karma is run, no errors are reported, and lots of files are created below the folder coverage
, including a very nicely formatted code coverage report in index.html
But nothing new shows up in TeamCity. No "Code Coverage" tab.
How do I configure karma to produce reports that show up in TeamCity?
Perhaps I can use set coverageReporter
to something appropriate, but what?
This setting makes no difference:
coverageReporter: {
type : 'html',
dir : 'coverage/'
},
Bonus question: how do I set Build Failure Conditions on the karma reported code coverage?