karma-coverage-istanbul-reporter
A karma reporter that uses the latest istanbul 1.x APIs (with full sourcemap support) to report coverage.
About
This is a reporter only and does not perform the actual instrumentation of your code. Webpack users should use the istanbul-instrumenter-loader and then use this karma reporter to do the actual reporting. See the test config for an e2e example of how to combine them.
Installation
npm install karma-coverage-istanbul-reporter --save-dev
Configuration
module.exports = function (config) {
config.set({
plugins: ['karma-coverage-istanbul-reporter'],
reporters: ['coverage-istanbul'],
coverageIstanbulReporter: {
reports: ['html', 'lcovonly', 'text-summary'],
dir: './coverage',
fixWebpackSourcePaths: true
}
});
}
Individual reporter options
Most reporters accept additional config options. You can pass these through the report-config
option like so:
config.set({
coverageIstanbulReporter: {
reports: ['html'],
dir: './coverage',
'report-options': {
html: {
subdir: 'html'
}
}
}
});
List of reporters and options
Credits
License
MIT