Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No Karma report on singlerun = false

I wonder if I am missing something trivial here, but I can not see any test reports if I have set up singlerun to true in karma config. It only shows that the browsers were launched and that is it. I can click on DEBUG and inspect the browser console log that way, but I would feel that one should be also see the results in the terminal too.

Thanks for the help!

My karma.config.js:

basePath: '../',

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],

frameworks: ['mocha', 'chai'],

files: [
  { pattern: 'test/vendor/indexeddbshim.min.js', watched: false },
  { pattern: 'tests.webpack.js', watched: false },
],

preprocessors: {
  'tests.webpack.js': ['webpack'],
},

webpack: {
  resolve: {
    root: [
      path.resolve('./test/vendor'),
    ],
    alias: {
      backbone: 'backbone',
      underscore: 'underscore',
    },
  },
  module: {
    loaders: [
      {
        // test: /^\.js$/,
        exclude: /(node_modules|bower_components|vendor)/,
        loader: 'babel-loader',
      },
    ],
  },
},

webpackServer: {
  noInfo: true,
},

// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,

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

// web server port
port: 9876,

// enable / disable colors in the output (reporters and logs)
colors: true,

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false,

plugins: [
  require('karma-webpack'),
  require('karma-mocha'),
  require('karma-chai'),
  require('karma-phantomjs-launcher'),
  require('karma-chrome-launcher'),
],
logLevel: config.LOG_INFO,   }); 
like image 812
Kazlauskis Avatar asked Mar 31 '16 08:03

Kazlauskis


1 Answers

From the comment above:

Setting singleRun: false assumes that you are explicitly start the karma-client manually.

This means that you start karma (technically the karma-server), then go to another terminal and type karma run.

Setting singleRun: true in your karma configuration will call karma run for you.

Here's the doc: Karma configuration - requirejs version

like image 100
MarcoL Avatar answered Sep 28 '22 09:09

MarcoL