Socket
Socket
Sign inDemoInstall

karma-coverage-istanbul-reporter

Package Overview
Dependencies
70
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    karma-coverage-istanbul-reporter

A karma reporter that uses the latest istanbul 1.x APIs (with full sourcemap support) to report coverage.


Version published
Weekly downloads
786K
increased by2.56%
Maintainers
1
Install size
11.8 MB
Created
Weekly downloads
 

Readme

Source

karma-coverage-istanbul-reporter

Build Status codecov npm version npm GitHub issues GitHub stars GitHub license

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

// karma.conf.js
module.exports = function (config) {
  
  config.set({
    plugins: ['karma-coverage-istanbul-reporter'],
    reporters: ['coverage-istanbul'],
    coverageIstanbulReporter: { // any of these options are valid: https://github.com/istanbuljs/istanbul-api/blob/47b7803fbf7ca2fb4e4a15f3813a8884891ba272/lib/config.js#L33-L38
      reports: ['html', 'lcovonly', 'text-summary'], // reports can be any that are listed here: https://github.com/istanbuljs/istanbul-reports/tree/590e6b0089f67b723a1fdf57bc7ccc080ff189d7/lib
      dir: './coverage', // base output directory
      fixWebpackSourcePaths: true // if using webpack and pre-loaders, work around webpack breaking the source path
    }
  });
  
}

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'], // make sure to specify the report in the array here as well as in report-options
    dir: './coverage',
    'report-options': {
      html: { // all options available at: https://github.com/istanbuljs/istanbul-reports/blob/590e6b0089f67b723a1fdf57bc7ccc080ff189d7/lib/html/index.js#L135-L137
        subdir: 'html' // outputs the report in ./coverage/html
      }
    }
  }
});

List of reporters and options

Credits

License

MIT

Keywords

FAQs

Last updated on 15 Feb 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc