admin管理员组文章数量:1420166
For some reason, Karma tries three times to open Chrome, and thinks it's unsuccessful. It works fine once it loads, and shows that it connects on two sockets.
I have Chrome installed in a different location than Karma defaults to, so I had to link to the absolute path of Chrome. I suspect this may have something to do with why it doesn't "see" that Chrome is running. Is this a bug or is there something I can do to fix this?
Here is my config:
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
});
};
For some reason, Karma tries three times to open Chrome, and thinks it's unsuccessful. It works fine once it loads, and shows that it connects on two sockets.
I have Chrome installed in a different location than Karma defaults to, so I had to link to the absolute path of Chrome. I suspect this may have something to do with why it doesn't "see" that Chrome is running. Is this a bug or is there something I can do to fix this?
Here is my config:
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
});
};
Share
Improve this question
asked Nov 25, 2013 at 7:09
RyanJMcGowanRyanJMcGowan
1,5151 gold badge16 silver badges33 bronze badges
1
- still a good question in 2018! – Natrium Commented May 31, 2018 at 5:52
2 Answers
Reset to default 2For me, closing the browser window by pressing the X button would cause this issue to occur. There is a flag called retryLimit which is set to 2 by default, see http://karma-runner.github.io/2.0/config/configuration-file.html.
If you set that to zero, by adding the line
retryLimit : 0,
somewhere in your config.set structure, the browser doesn't pop up after you close it. Though, the fact that that flag exists makes me think that you are normally supposed to close karma by some other means...
I think instead of providing the absolute path, you should set the path to chrome binary in your environmental variables. You can set it manually, or follow the instructions here: http://karma-runner.github.io/2.0/config/browsers.html
本文标签: javascriptKarma opens three times in Chrome Karma BugStack Overflow
版权声明:本文标题:javascript - Karma opens three times in Chrome. Karma Bug? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745323416a2653482.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论