业力:无法启动镀铬

时间:2015-10-27 11:05:32

标签: jasmine karma-runner runner

对于我的angularjs项目,尝试使用karma + jamine进行单元测试。我安装了karma @ local并试图从.bin文件夹开始。所以我得到了以下问题;仅供参考我正在粘贴文件夹结构,

错误:

C:\Workspace\node_modules.bin>karma start ../../karma.conf.js
27 10 2015 09:57:06.461:WARN [karma]: No captured browser, open http://localhost:9876/
27 10 2015 09:57:06.486:INFO [karma]: Karma v0.13.11 server started at http://localhost:9876/
27 10 2015 09:57:06.500:INFO [launcher]: Starting browser Chrome
27 10 2015 09:57:07.111:ERROR [launcher]: Cannot start Chrome
27 10 2015 09:57:07.119:INFO [launcher]: Trying to start Chrome again (1/2).
27 10 2015 09:57:07.491:ERROR [launcher]: Cannot start Chrome
27 10 2015 09:57:07.493:INFO [launcher]: Trying to start Chrome again (2/2).
27 10 2015 09:57:08.234:ERROR [launcher]: Cannot start Chrome
27 10 2015 09:57:08.236:ERROR [launcher]: Chrome failed 2 times (cannot start).Giving up.
27 10 2015 09:57:08.633:INFO [Chrome 46.0.2490 (Windows 7 0.0.0)]: Connected on
socket PgWwwQDh6BZ7k9fpAAAA with id 74171654
27 10 2015 09:57:18.954:WARN [Chrome 46.0.2490 (Windows 7 0.0.0)]: Disconnected
(1 times), because no message in 10000 ms.
27 10 2015 09:57:18.957:ERROR [karma]: [TypeError: Cannot read property 'map' of
undefined]TypeError: Cannot read property 'map' of undefined at _render (C:\Workspace\node_modules\karma\lib\reporters\progress.js:51:26)
at _refresh (C:\Workspace\node_modules\karma\lib\reporters\progress.js:55:34)
at onBrowserComplete (C:\Workspace\node_modules\karma\lib\reporters\prog
ress.js:15:21)
at null. (C:\Workspace\node_modules\karma\lib\events.js:13:22
)
at emitOne (events.js:82:20)
at emit (events.js:169:7)
at null._onTimeout (C:\Workspace\node_modules\karma\lib\browser.js:50:15
)
at Timer.listOnTimeout (timers.js:89:15)

文件夹结构: node_modules SRC 测试 karma.conf 的package.json

karma.conf文件

module.exports = function(config) {
config.set({
frameworks: ['jasmine'],
plugins: [
'karma-phantomjs-launcher',
'karma-jasmine',
'karma-coverage',
'karma-chrome-launcher' ,
'karma-firefox-launcher',
'karma-requirejs',
'karma-ie-launcher' 
],
files: [
'src/assets/js/angular.js',
'src/assets/js/angular-mocks.js',
'src/app//.js',
'test/.js'
],
preprocessors: {
'src/app//*.js': ['coverage']
},
reporters: ['progress','coverage'],
coverageReporter: {
type: 'html',
dir: 'coverage'
},
logLevel: config.LOG_INFO,
browsers: ['Chrome'],
singleRun: false
});

0 个答案:

没有答案