I am using karma
as a jasmine test runner, with instanbul
as a code coverage tool. All works perfectly, one question though - is there any way I could change the path to the report that is created?
ie for Chrome I get /coverage/Chrome%2035.0.1916%20(Windows%207)/index.html
; I would much more happy with /coverage/Chrome/index.html
Any suggestions much appreciated.
Add this to your karma.conf.js:
coverageReporter: {
dir: 'coverage/',
subdir: 'Chrome',
file: 'index.html'
}
EDIT: To have a subdir name based on the name of the browser used for the test:
coverageReporter: {
dir: 'coverage',
subdir: function(browser) {
return browser.toLowerCase().split(/[ /-]/)[0];
},
file: 'index.html'
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.