当前位置: 代码迷 >> JavaScript >> 手工装配 grunt.js/phantomJs/grunt-jasmine-runner 一些经验
  详细解决方案

手工装配 grunt.js/phantomJs/grunt-jasmine-runner 一些经验

热度:402   发布时间:2012-11-26 11:48:49.0
手工安装 grunt.js/phantomJs/grunt-jasmine-runner 一些经验

some experience to manually install grunt.js/phantomJs/grunt-jasmine-runner


1.      Grunt.js/node.js should be quite easy toonce-click install if this centOS5 server has a internet connection, but, forthis server, I have to copy the .tar manually, then copy all modules andplugins by finding the right place to put

2.      Grunt-jasmine-runner require phantomJs to rununit test. At first, I tried to run the complied version for linux, but itrequires libgc v2.9+ , which finally I realize centOS5 can’t afford such highversion (even forcely compile that lib with low version gcc compiler, possiblywill make the low version linux core crash).

3.      Then I tried to compile phantomJs 1.7 manually,which depends on 30+ libs. Those can be download from http://mirror.centos.org/centos/5/os/x86_64/CentOS/then copy to server, and run with rpm command in turn. Fortunately, it works

4.      The last tricky one, the passed unit test failson that server by run ‘grunt jasmine’. 

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
...

At last, it’s caused by that: I createda symbolic link for “node_modules” to re-use common module, but it preventgrunt-jasmine-runner to fetch sth. (not sure yet). To resolve it, need to copythe “node_modules” files directly under project folder.


  相关解决方案