噶茉莉NPMconfiguration

业力configuration错误

我正在尝试configuration我的testing环境,并在尝试运行业力时获得以下错误。

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优胜美地10.10.5,是的,那里有一个独立的testing,“希望是真实的”,只是为了让它自己启动和运行。 我正在写的应用程序是Angular,但我还没有触及任何testing。 我只想让基本的testing人员先行工作。

任何帮助将是伟大的。 谢谢。

karma中的浏览器采用英文格式( ChromeFirefoxPhantomJS ),而不是各自的插件名称。 插件只需要安装npm install --save

另外:Karma会“奇迹般地”在node_modules目录中加载任何以node_modules开头的karma- ,所以你不需要在你的configuration文件中声明plugins: