我遇到了与这里描述的相同的问题,Can't get PhantomJS to work with a simple example,但是在我的道路上拥有正确的phantomjs版本的解决方案似乎并不能解决我的问题。
我按照教程找到了一个T:http://net.tutsplus.com/tutorials/javascript-ajax/testing-javascript-with-phantomjs/?search_index=1
在我尝试添加require('webpage').create()之前,一切都运行得很好。
phantomjs版本1.8.1 mocha-phantomjs 2.0.0
我还能遗漏什么呢?
发布于 2013-06-06 11:27:25
我也有这个问题,问题是我的mocha版本--回到1.9.0修复了它。
发布于 2014-08-14 07:41:13
使用require-stub获取require以满足测试需求。
https://stackoverflow.com/questions/14773951
复制相似问题