1

I have a simple case, where I need to run grunt jasmine test. After running

grunt jasmine

i get error response:

Running "jasmine" task                                                                                                                                                                               
Testing jasmine specs via phantom                                                                                                                                                                    

events.js:66                                                                                                                                                                                         
        throw arguments[1]; // Unhandled 'error' event                                                                                                                                               
                       ^                                                                                                                                                                             
Error: listen EACCES                                                                                                                                                                                 
    at errnoException (net.js:769:11)                                                                                                                                                                
    at Server._listen2 (net.js:892:19)                                                                                                                                                               
    at listen (net.js:936:10)                                                                                                                                                                        
    at Server.listen (net.js:985:5)                                                                                                                                                                  
    at Function.app.listen (/var/lib/stickshift/f1dad82f1ce14cd0bbaaa971c75eeedc/app-root/data/380712/node_modules/grunt-jasmine-runner/node_modules/connect/lib/proto.js:229:24)                    
    at Object.exports.start (/var/lib/stickshift/f1dad82f1ce14cd0bbaaa971c75eeedc/app-root/data/380712/node_modules/grunt-jasmine-runner/tasks/lib/server.js:17:17)                                  
    at startServer (/var/lib/stickshift/f1dad82f1ce14cd0bbaaa971c75eeedc/app-root/data/380712/node_modules/grunt-jasmine-runner/tasks/jasmine.js:141:17)                                             
    at Function.task.phantomRunner (/var/lib/stickshift/f1dad82f1ce14cd0bbaaa971c75eeedc/app-root/data/380712/node_modules/grunt-jasmine-runner/tasks/jasmine.js:109:16)                             
    at Object.<anonymous> (/var/lib/stickshift/f1dad82f1ce14cd0bbaaa971c75eeedc/app-root/data/380712/node_modules/grunt-jasmine-runner/tasks/jasmine.js:50:10)                                       
    at Object.task.registerTask.thisTask.fn (/var/lib/stickshift/f1dad82f1ce14cd0bbaaa971c75eeedc/app-root/data/380712/node_modules/grunt/lib/grunt/task.js:58:16)  

The hint that Cloud9 gives me is

 Cloud9  Error: you may be using the wrong PORT & HOST for your server app                                                                                                                           
         Node: use 'process.env.PORT' as the port and 'process.env.IP' as the host in your app scripts 

So my question is How do I configure PORT & HOST ?

4

2 回答 2

1

当前关于 grunt-jasmine-runner 的文档具有误导性(indetnation):

事实证明,我必须将服务器配置为对象文字:

//...
'jasmine' : {
  server:{
    port:process.env.PORT
  }
//...
于 2013-01-24T18:06:08.790 回答
0

您需要在 config.rb 中添加端口和主机的值:

jasmine_port=ENV['PORT']
jasmine_host=ENV['IP']
于 2013-01-19T09:47:03.947 回答