Unable to run Coverage with Karma

I got the same [WARN] because the plugin ‘karma-coverage’ was not defined inside the plugins of the config, try to see if adding it fixes your warning, not sure if it will fix your full problem.

plugins: [
  'karma-jasmine',
  'karma-coverage',
  'karma-chrome-launcher',
  'karma-firefox-launcher',
],

UPDATE:
I also had a different problem when running the coverage, caused by istanbul, my error was

[coverage]: [TypeError: Cannot set property ‘covered’ of undefined]

After having a look what istanbul was doing it turned out that the paths to some of my js unit files were outdated in the preprocessors.

It was doing some of the coverage reports but it was not generating deep coverage reports for all files hence the error. Once I fixed the paths it was all good.

    preprocessors : {
        '**/app/js/*/*.js' : 'coverage',
        '**/app/js/modules/*/*.js' : 'coverage',
        '**/app/js/services/*/*.js' : 'coverage'
    }, 

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)