Skip to content

Call remap-istanbul as a karma reporter, enabling remapped reports on watch

License

Notifications You must be signed in to change notification settings

Mixbook/karma-remap-istanbul

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

karma-remap-istanbul

Call remap-istanbul as a karma reporter, enabling remapped reports on watch

installation

Install karma-remap-istanbul as a dev-dependency in your project.

npm install karma-remap-istanbul --save-dev

configuration

Add the plugin, reporter and reporter configuration in your karma.conf.js.

{
  plugins: ['karma-remap-istanbul'],
  reporters: ['progress', 'karma-remap-istanbul'],
  remapIstanbulReporter: {
    src: 'path/to/generated/coverage/report.json',
    reports: {
      lcovonly: 'path/to/output/coverage/lcov.info',
      html: 'path/to/output/html/report'
    },
    timeoutNotCreated: 1000, // default value
    timeoutNoMoreFiles: 1000 // default value
  }
}

Example configuration with karma-coverage

{
  preprocessors: {
    'build/**/!(*spec).js': ['coverage']
  },
  plugins: ['karma-remap-istanbul', 'karma-coverage'],
  reporters: ['progress', 'coverage', 'karma-remap-istanbul'],
  coverageReporter: {
    reporters: [{
      type: 'json',
      subdir: '.', 
      file: 'coverage-final.json'
    }]
  },
  remapIstanbulReporter: {
    src: 'coverage/coverage-final.json',
    reports: {
      html: 'coverage'
    }
    timeoutNotCreated: 1000,
    timeoutNoMoreFiles: 1000
  }
}

You may want to install karma-coverage and register it as a reporter before karma-remap-istanbul for this reporter to be sensible. The src can be either a string to a json file or array to multiple json files, which will be processed in one report. This, and the possible reporter options can be found in the remap-istanbul project README.

About

Call remap-istanbul as a karma reporter, enabling remapped reports on watch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%