ibrik-instrumenter-loader
v0.1.1
Published
Ibrik instrumenter loader for webpack
Downloads
316
Maintainers
Readme
Ibrik instrumenter loader for webpack
Instrument JS files with Ibrik for subsequent code coverage reporting.
Install
$ npm install --save-dev ibrik-instrumenter-loader
Usage
Useful to get work together karma-webpack and karma-coverage. For example:
- karma-webpack config
- karma-coverage config
- replace
karma-coverage
's code instrumenting withibrik-instrumenter-loader
's one:
config.set({
...
files: [
// 'src/**/*.js', << you don't need this anymore
'test/**/*.js'
],
...
preprocessors: {
// 'src/**/*.js': ['coverage'], << and this too
'test/**/*.js': [ 'webpack' ]
},
reporters: [ 'progress', 'coverage' ],
coverageReporter: {
type: 'html',
dir: 'coverage/'
},
...
webpack: {
...
module: {
preLoaders: [ // << add subject as webpack's preloader
{
test: /\.coffee$/,
// exclude this dirs from coverage
exclude: /(test|node_modules|bower_components)\//,
loader: 'ibrik-instrumenter-loader'
},
],
// other webpack loaders excluding coffeescript ...
loaders: [ ... ],
},
...
}
});