我使用phantomjs 1.9.16。
当我使用karma runnter运行我的单元测试时,我被要求:
“捕获浏览器打开http://localhost:9999/tests/”
我在我的WebStorm 10 IDE中执行此操作,然后单击上面的消息以打开默认浏览器。
然后在浏览器视口中显示“Karma - starting”。
WebStrom IDE中的Karma-Server选项卡具有以下输出:
"C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\JetBrains\WebStorm 10.0.1\plugins\js-karma\js_reporter\karma-intellij\lib\intellijServer.js" --karmaPackageDir=C:\MyApp\node_modules\karma --configFile=C:\MyApp\test\karma.conf.js
INFO [karma]: Karma v0.12.32 server started at http://localhost:9999/tests/
INFO [launcher]: Starting browser PhantomJS
WARN [web-server]: 404: /tests/socket.io/socket.io.js
WARN [web-server]: 404: /tests/socket.io/socket.io.js
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start PhantomJS again (1/2).
WARN [web-server]: 404: /tests/socket.io/socket.io.js
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
INFO [launcher]: Trying to start PhantomJS again (2/2).
WARN [web-server]: 404: /tests/socket.io/socket.io.js
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
ERROR [launcher]: PhantomJS failed 2 times (timeout). Giving up.
karma还是phantomjs的问题?
实际上它在我看来=> WARN [web-server]:404:/tests/socket.io/socket.io.js
当我在view-source下查看html页面的源代码时,找不到socket.io.js:http://localhost:9999/tests/