gpt4 book ai didi

node.js - Karma 测试运行程序 - 无法捕获 chrome

转载 作者:搜寻专家 更新时间:2023-11-01 00:15:19 25 4
gpt4 key购买 nike

我正在使用 Yeoman 生成 AngularJS 应用程序。运行 grunt serve 预览我的应用程序工作正常,但是当我尝试使用 grunt test 运行测试时,我的控制台出现以下错误:

Running "karma:unit" (karma) task
DEBUG [plugin]: Loading karma-* from D:\dev\wamp\www\tests\app\node_modules
DEBUG [plugin]: Loading plugin D:\dev\wamp\www\tests\app\node_modules/karma-chrome-launcher.
DEBUG [plugin]: Loading plugin D:\dev\wamp\www\tests\app\node_modules/karma-coffee-preprocessor.
DEBUG [plugin]: Loading plugin D:\dev\wamp\www\tests\app\node_modules/karma-firefox-launcher.
DEBUG [plugin]: Loading plugin D:\dev\wamp\www\tests\app\node_modules/karma-html2js-preprocessor.
DEBUG [plugin]: Loading plugin D:\dev\wamp\www\tests\app\node_modules/karma-jasmine.
DEBUG [plugin]: Loading plugin D:\dev\wamp\www\tests\app\node_modules/karma-ng-html2js-preprocessor.
DEBUG [plugin]: Loading plugin D:\dev\wamp\www\tests\app\node_modules/karma-ng-scenario.
DEBUG [plugin]: Loading plugin D:\dev\wamp\www\tests\app\node_modules/karma-phantomjs-launcher.
DEBUG [plugin]: Loading plugin D:\dev\wamp\www\tests\app\node_modules/karma-requirejs.
DEBUG [plugin]: Loading plugin D:\dev\wamp\www\tests\app\node_modules/karma-script-launcher.
INFO [karma]: Karma v0.10.8 server started at http://localhost:8080/
INFO [launcher]: Starting browser Chrome
DEBUG [launcher]: Creating temp dir at C:\Users\shlomis\AppData\Local\Temp\karma-91802655
DEBUG [launcher]: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --user-data-dir=C:\Users\shlomis\AppData\Local\Temp\karma-91802655 --no-default-browser-check --no-first-run --disable-def
ault-apps --start-maximized http://localhost:8080/?id=91802655
WARN [watcher]: Pattern "D:/dev/wamp/www/tests/app/test/mock/**/*.js" does not match any file.
DEBUG [watcher]: Resolved files:
D:/dev/wamp/www/tests/app/node_modules/karma-jasmine/lib/jasmine.js
D:/dev/wamp/www/tests/app/node_modules/karma-jasmine/lib/adapter.js
D:/dev/wamp/www/tests/app/app/bower_components/angular/angular.js
D:/dev/wamp/www/tests/app/app/bower_components/angular-mocks/angular-mocks.js
D:/dev/wamp/www/tests/app/app/scripts/app.js
D:/dev/wamp/www/tests/app/app/scripts/controllers/main.js
D:/dev/wamp/www/tests/app/test/spec/controllers/main.js
DEBUG [web-server]: serving: D:\dev\wamp\www\tests\app\node_modules\karma\static/client.html
DEBUG [web-server]: serving: D:\dev\wamp\www\tests\app\node_modules\karma\static/karma.js
DEBUG [karma]: A browser has connected on socket 1ozU-x__3w49R5zevWXm
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
Warning: Task "karma:unit" failed. Use --force to continue.

Aborted due to warnings.
  • Node v0.10.23
  • karma 版本:0.10.8

我错过了什么?

最佳答案

在 karma.conf.js 文件中将默认端口 (8080) 更改为 9876 为我解决了这个问题

关于node.js - Karma 测试运行程序 - 无法捕获 chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20629578/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com