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, });
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With