node.js - 通过 phantom 运行 jasmine specs,得到 "Can' t 找到变量 : describe"

标签 node.js jasmine phantomjs

我在 centOS5 linux 服务器上运行它作为 CI 作业时遇到了同样的问题,使用 phantomJS 1.7(我自己编译的)

Running "jasmine" task 
Testing jasmine specs via phantom 
...  
[D] ["phantomjs","onResourceReceived","GET
http://127.0.0.1:8888/test/spec/CommonTest.js"]
[D] ["phantomjs","onError","ReferenceError: Can't find variable: describe",        [{"file":"http://127.0.0.1:8888/test/spec/CommonTest.js","line":31,"function":""}]]     
ReferenceError: Can't find variable: describe 
...

规范在其他机器如 WinXP 等上运行成功

最佳答案

最后,它是由以下原因引起的:我为“node_modules”创建了一个符号链接(symbolic link)以重新使用公共(public)模块,但它阻止了 grunt-jasmine-runner 获取某物。 (还不确定)。要解决它,需要将“node_modules”文件直接复制到项目文件夹下。

关于node.js - 通过 phantom 运行 jasmine specs,得到 "Can' t 找到变量 : describe",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13506393/

相关文章:

node.js - 如何从脚本中退出 nodeJS 脚本?

javascript - 获取回调结果(Nodejs)

angular - Karma 在我的 angular-cli 应用程序中找不到我的测试

javascript - 测试初始化​​函数中设置的 Backbone 事件

node.js - 如何针对 Alexa 技能的错误和警告发出警报?

node.js - 如何在 CloudFoundry 上运行 Node 检查器?

javascript - Jasmine beforeEach 不等待完成回调

angularjs - TeamCity : PhantomJS have not captured in 60000 ms, 查杀

node.js - phantom 没有方法 'create'

selenium - 如何使用 Phantomjs 在 Selenium 中打开网站