Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve Reporter "spec" does not exists in karma?

I have a project that used generator-angular version 0.3.0 and I am trying to add a spec reporter to its karma tests, but I keep getting Reporter "spec" does not exists in karma

After reading some resources, I did the following steps

  • ran the command npm install karma-spec-reporter --save-dev
  • I modified the karma configuration file (added 'spec')

    reporters = ['progress','dots','junit','spec'];

  • I ran grunt (which in turn runs karma ) and got the error

How can I get the spec reporter to work in my environment?

like image 434
guy mograbi Avatar asked Sep 06 '14 10:09

guy mograbi


1 Answers

Just ran into the same issue.

Gets fixed by loading the plugin, but the user guides at NPM and github for the some of Karma plugins are not mentioning it anywhere.

       plugins: ['karma-chrome-launcher', 'karma-jasmine', 'karma-coverage', 'karma-browserify', 'karma-spec-reporter'],

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['coverage', 'progress', 'spec'],

Update: there is a new version of this plugin that does tell you to load it.

https://www.npmjs.com/package/karma-spec-reporter-2

like image 63
Eduardo Chongkan Avatar answered Oct 05 '22 10:10

Eduardo Chongkan