Ibrik instrumenter loader for webpack
HTML JavaScript
Switch branches/tags
Clone or download
Pull request Compare This branch is 5 commits ahead, 14 commits behind ColCh:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
.editorconfig
.eslintrc
.gitignore
.jscsrc
.npmignore
.travis.yml
History.md
README.md
index.js
package.json

README.md

Ibrik instrumenter loader for webpack

Instrument JS files with Ibrik for subsequent code coverage reporting.

Downloads Code Climate David Dependencies

Install

$ npm install --save-dev ibrik-instrumenter-loader

Usage

Useful to get work together karma-webpack and karma-coverage. For example:

  1. karma-webpack config
  2. karma-coverage config
  3. replace karma-coverage's code instrumenting with ibrik-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: [ ... ],
        },
        ...
    }
});

Documentation: Using loaders.

License

WTFPL