Karma在Chrome中打开了三次.卡玛虫?

Rya*_*wan 11 javascript google-chrome karma-runner

出于某种原因,Karma尝试三次打开Chrome,并认为它不成功.它加载后工作正常,并显示它连接在两个插座上.

我将Chrome安装在与Karma默认设置不同的位置,因此我必须链接到Chrome的绝对路径.我怀疑这可能与为什么它没有"看到"Chrome正在运行有关.这是一个错误还是我可以做些什么来解决这个问题?

这是我的配置:

module.exports = function(config) {
config.set({

// base path, that will be used to resolve files and exclude
basePath: '',


// frameworks to use
frameworks: ['jasmine'],


// list of files / patterns to load in the browser
files: [
    '../../Scripts/angular.js',
    '../../Scripts/angular-*.js',
    '*.spec.js',
    '*.js'
],


// list of files to exclude
exclude: [
  '../../Scripts/angular-scenario.js',
],


// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['progress'],


// web server port
port: 9876,


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


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


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

// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ["C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"],

// If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000,

// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
});
};
Run Code Online (Sandbox Code Playgroud)

Ale*_* Li 1

对我来说,按 X 按钮关闭浏览器窗口会导致出现此问题。有一个名为 retryLimit 的标志,默认设置为 2,请参阅http://karma-runner.github.io/2.0/config/configuration-file.html

如果将其设置为零,请添加行

retryLimit : 0,
Run Code Online (Sandbox Code Playgroud)

在 config.set 结构中的某个位置,关闭浏览器后不会弹出浏览器。不过,该旗帜存在的事实让我认为你通常应该通过其他方式来关闭业力......