【发布时间】:2015-10-06 20:05:51
【问题描述】:
业力配置错误
我正在尝试配置我的测试环境,并在尝试运行 karma 时遇到以下错误。
karma start
06 10 2015 13:13:36.859:DEBUG [plugin]: Loading plugin karma-jasmine.
06 10 2015 13:13:36.917:DEBUG [karma]: List of files has changed, trying to execute
06 10 2015 13:13:36.918:WARN [karma]: No captured browser, open http://localhost:9876/
06 10 2015 13:13:36.922:DEBUG [watcher]: Watching ".../representative-summary/node_modules/angular"
06 10 2015 13:13:36.922:DEBUG [watcher]: Watching ".../representative-summary/node_modules/angular-resource"
06 10 2015 13:13:36.923:DEBUG [watcher]: Watching ".../representative-summary/spec"
06 10 2015 13:13:36.927:WARN [launcher]: Can not load "karma-chrome-launcher", it is not registered!
Perhaps you are missing some plugin?
06 10 2015 13:13:36.927:WARN [launcher]: Can not load "karma-firefox-launcher", it is not registered!
Perhaps you are missing some plugin?
06 10 2015 13:13:36.928:WARN [launcher]: Can not load "karma-safari-launcher", it is not registered!
Perhaps you are missing some plugin?
06 10 2015 13:13:36.928:WARN [launcher]: Can not load "karma-ie-launcher", it is not registered!
Perhaps you are missing some plugin?
06 10 2015 13:13:36.928:WARN [launcher]: Can not load "karma-phantomjs-launcher", it is not registered!
Perhaps you are missing some plugin?
karma.conf.js
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine'],
files: [
{pattern: 'node_modules/angular/*.js', included: true},
{pattern: 'node_modules/angular-resource/*.js', included: true},
{pattern: 'spec/*.spec.js', included: true}
],
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_DEBUG,
//config.LOG_INFO,
autoWatch: true,
browsers: [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-safari-launcher',
'karma-phantomjs-launcher'
],
plugins: ['karma-jasmine'],
singleRun: false
})
};
我在 OSX Yosemite 10.10.5 上,是的,那里有一个独立的测试“期望为真”,只是为了让它自行启动和运行。我正在编写的应用程序是 Angular,但我还没有触及任何测试。我只想让基本的测试运行器首先正常工作。
任何帮助都会很棒。谢谢。
【问题讨论】:
-
这不是您的
browsers条目应有的内容。请阅读 Karma 手册以了解配置文件的结构。 -
当然。我确实知道这一点。谢谢你的提示。 @MadaraUchiha,你应该把它放在一个答案中,这样我就可以给你信用......
标签: angularjs node.js configuration karma-runner karma-jasmine