1

I currently have a problem with Karma (0.12.31), when running with the karma-coverage plugin.

Executing Karma, without coverage, the tests are running after a few seconds. If I execute karma with karma-coverage plugin it will take significantly more time. I know coverage can take more time, but I think the amount of time is ridiculous.

With karma-coverage I get the message "karma chrome have not captured in 60000 ms, killing", then karma kills Chrome (i'm using 43.0.2357.132). After 5 minutes, a new Chrome window is open and after a few seconds the tests are finally executed.

Is my configuration correct and it's "normal" having to wait that long? We're talking about 4000 tests, even though I'm just running 12 of those 4000.

This is my karma.conf.js file:

module.exports = function(config){
  config.set({
      browserNoActivityTimeout: 60000,
      basePath : '../',
      preprocessors: {
          'templates/*.tmpl.html': ['ng-html2js'],
          'scripts/**/**/*.js': ['coverage']
      },     
      files: [
          {pattern: 'Styles/images/*.png', included: false, served: true},
          'scripts/vendor/jquery-1.11.1.min.js',
          'scripts/vendor/angular.js',
          'tests/unit/angular-mocks.js',
          'scripts/vendor/jquery.signalR-2.1.2.min.js',
          'scripts/vendor/breeze.debug.js',
          'scripts/vendor/go-debug.js',
          'scripts/vendor/jqx-all.js',
          'templates/*.tmpl.html',
          'scripts/app.js',
          'scripts/**/**/*.js',
          'tests/unit/modelMetadata.js',
          'tests/unit/solutionMetadata.js',
          'tests/unit/testUtils/*.js',
          'tests/unit/**/**/*.js'
      ],
      proxies: {
          '/styles': 'http://localhost:9876/styles/images',
          '/scripts': 'http://localhost:9876/scripts/modules/ironPython'
      },
      autoWatch : true,
      frameworks: ['jasmine'],
      browsers : ['Chrome'/*, 'IE'*/], //, 'Firefox'
      plugins : [
          'karma-coverage',
          'karma-chrome-launcher',
          //'karma-firefox-launcher',
          //'karma-ie-launcher',
          'karma-jasmine',
          //'karma-teamcity-reporter',
          'karma-ng-html2js-preprocessor'
      ],
      reporters: ['progress', 'coverage'],
      ngHtml2JsPreprocessor: {
          moduleName: 'templates'
      },
   coverageReporter: {
  type : 'html',
  // where to store the report
  dir : 'coverage/'
  }
  });
};
bluestrattos
  • 49
  • 1
  • 1
  • 12
  • 3
    If you set the `logLevel` to `config.LOG_DEBUG` can you verify that `karma-coverage` is the one who's taking long? – MarcoL Jul 08 '15 at 09:42
  • Thanks for your tip, with log level. After I run with --log-level debug, I could see that it was jqx-all.js (with 5mb) that was actually taking too much time. I'll now, be more specific with hte folder where I've the scripts. – bluestrattos Jul 08 '15 at 10:23
  • possible duplicate of [Karma can't capture PhantomJS](http://stackoverflow.com/questions/17451617/karma-cant-capture-phantomjs) – Paul Sweatte Jul 16 '15 at 20:06
  • @PaulSweatte I don't see it as a duplicate. In this particular case, the problem was the amount of time that Karma needed before start the unit tests with coverage – bluestrattos Jul 17 '15 at 08:20

0 Answers0