karma-coverage-istanbul-reporter
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/karma-coverage-istanbul-reporter package

0.2.0 • Public • Published

karma-coverage-istanbul-reporter

Build Status codecov

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
      fixWebpackSourcePaths: true // if using webpack and pre-loaders, work around webpack breaking the source path
    }
  });
  
}

Credits

License

MIT

Package Sidebar

Install

npm i karma-coverage-istanbul-reporter@0.2.0

Version

0.2.0

License

MIT

Last publish

Collaborators

  • mattlewis92