在我的测试中未能运行phantomjs

时间:2017-07-18 15:40:30

标签: javascript karma-runner vuejs2

我跟着https://github.com/vuejs-templates/webpack安装了我的项目,现在我想测试它。

当我运行cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run无法运行时,我看到了这些错误:

PhantomJS have not captured in 60000 ms, killing.
Trying to start PhantomJS again (1/2).
PhantomJS have not captured in 60000 ms, killing.
Trying to start PhantomJS again (2/2).
PhantomJS have not captured in 60000 ms, killing.
PhantomJS failed 2 times (timeout). Giving up.

知道我已将此行添加到~/.bashrc

export PATH="$HOME/path/to/project/node_modules/.bin:$PATH"

在我的终端:

 --> phantomjs -v
 2.1.1

1 个答案:

答案 0 :(得分:1)

默认情况下,Karma会侦听localhost,如果无法解决,则会在没有有意义错误的情况下失败。在某些时候,您可能已从127.0.0.1 localhost移除/etc/hosts - 尝试重新添加它,它应该会有所帮助。

信用转到zewish