lazd / gulp-karma

Karma plugin for gulp
MIT License
75 stars 36 forks source link

WARN [reporter]: Can not load "coverage" #5

Closed hhelwich closed 10 years ago

hhelwich commented 10 years ago

I get the following warning:

WARN [reporter]: Can not load "coverage", it is not registered!
  Perhaps you are missing some plugin?

I have the following block in my karma.conf.js file:

preprocessors: {
  '**/build/*.js': 'coverage'
},
reporters: ['progress', 'coverage'],

In my package.json i have the dependency "karma-coverage": "~0.1.4" which solves the warning if i run karma directly, but does seem to have no effect on gulp-karma.

lazd commented 10 years ago

Karma will load plugins local to it by default. Since the version of karma that gulp-karma was using was inside of gulp-karma/node_modules, karma-coverage was not available for discovery.

I made karma a peerDependency of gulp-karma, which causes it to be installed in the project itself (not it it's own node_modules folder), allowing automatic discovery of plugins.

Closed by a1d34ece9738afcc152c73b2a0d6642f711f21b5. Please try with gulp-karma@0.0.2, your issue should be fixed.

In other cases where you get this error, try specifying the plugin in the plugins array (see Karma docs on plugins):

  plugins: [
      'karma-coverage',
      'karma-jasmine',
      'karma-chrome-launcher',
      'karma-firefox-launcher'
    ]
hhelwich commented 10 years ago

:+1: