【发布时间】:2014-05-13 20:33:50
【问题描述】:
我正在尝试使用如下代码测试我的服务器:
describe 'POST /do/some/stuff/', ->
it 'should do this thing', (done) ->
request app
.post '/do/some/stuff/'
.timeout 10000
.expect 200
.end (err, res) ->
return done err if err?
done()
服务器所做的事情通常需要几秒钟,这比默认的超时时间2000ms要长,所以我调用.timeout 10000。然而,尽管如此,当我运行代码时,我得到:
1) POST /do/some/stuff/ should do this thing:
Error: timeout of 2000ms exceeded
我需要做些什么来增加这个超时时间?
【问题讨论】:
标签: node.js mocha.js supertest