Package Exports
- karma-coverage-istanbul-reporter
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (karma-coverage-istanbul-reporter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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
Add the configuration in your karma.conf.js
.
module.exports = function (config) {
config.set({
plugins: ['karma-coverage-istanbul-reporter'],
reporters: ['coverage-istanbul'],
coverageIstanbulReporter: {
reports: ['json-summary'], // reports can be any that are listed here: https://github.com/istanbuljs/istanbul-reports/tree/master/lib
dir: './coverage' // output directory
}
});
}
Credits
- Original karma-coverage source: https://github.com/karma-runner/karma-coverage/blob/master/lib/reporter.js
- Example of using the new reporter API: https://github.com/facebook/jest/blob/master/scripts/mapCoverage.js
- Karma remap istanbul: https://github.com/marcules/karma-remap-istanbul
License
MIT