没有关于 singlerun 的 Karma 报告 = false
No Karma report on singlerun = false
我想知道我是否在这里遗漏了一些微不足道的东西,但是如果我在 karma 配置中将 singlerun 设置为 true,我将看不到任何测试报告。它仅显示浏览器已启动,仅此而已。我可以单击 DEBUG 并以这种方式检查浏览器控制台日志,但我觉得也应该在终端中看到结果。
感谢您的帮助!
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, });
来自上面的评论:
设置 singleRun: false
假定您明确手动启动 karma-client。
这意味着您启动 karma(技术上是 karma-server),然后转到另一个终端并键入 karma run
。
在您的 karma 配置中设置 singleRun: true
将为您调用 karma 运行。
我想知道我是否在这里遗漏了一些微不足道的东西,但是如果我在 karma 配置中将 singlerun 设置为 true,我将看不到任何测试报告。它仅显示浏览器已启动,仅此而已。我可以单击 DEBUG 并以这种方式检查浏览器控制台日志,但我觉得也应该在终端中看到结果。
感谢您的帮助!
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, });
来自上面的评论:
设置 singleRun: false
假定您明确手动启动 karma-client。
这意味着您启动 karma(技术上是 karma-server),然后转到另一个终端并键入 karma run
。
在您的 karma 配置中设置 singleRun: true
将为您调用 karma 运行。