Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/431.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 业力在Chrome中打开三次。因果报应?_Javascript_Google Chrome_Karma Runner - Fatal编程技术网

Javascript 业力在Chrome中打开三次。因果报应?

Javascript 业力在Chrome中打开三次。因果报应?,javascript,google-chrome,karma-runner,Javascript,Google Chrome,Karma Runner,出于某种原因,Karma尝试了三次打开Chrome,但认为没有成功。一旦加载,它就可以正常工作,并显示它在两个套接字上连接 我把Chrome安装在了与Karma默认设置不同的位置,所以我必须链接到Chrome的绝对路径。我怀疑这可能与为什么它没有“看到”Chrome正在运行有关。这是一个bug还是我可以做些什么来修复它 这是我的配置: module.exports = function(config) { config.set({ // base path, that will be used

出于某种原因,Karma尝试了三次打开Chrome,但认为没有成功。一旦加载,它就可以正常工作,并显示它在两个套接字上连接

我把Chrome安装在了与Karma默认设置不同的位置,所以我必须链接到Chrome的绝对路径。我怀疑这可能与为什么它没有“看到”Chrome正在运行有关。这是一个bug还是我可以做些什么来修复它

这是我的配置:

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
});
};

我认为不应该提供绝对路径,而应该在环境变量中将路径设置为chrome二进制。 您可以手动设置,也可以按照以下说明操作:

对于我来说,按X按钮关闭浏览器窗口会导致出现此问题。有一个名为retryLimit的标志,默认设置为2,请参阅

如果将其设置为零,则通过添加行

retryLimit : 0,

在config.set结构中的某个地方,浏览器在关闭后不会弹出。尽管如此,这面旗帜的存在让我觉得你通常应该通过其他方式来结束业力…

在2018年仍然是个好问题!您应该在此处包含这些说明,外部链接应仅提供附加信息或作为源引用。设置二进制文件的路径取决于您使用的平台。例如,在Windows上:C:>设置CHROME\u BIN=