如何更改jasmine-node异步规范的超时 [英] How do I change the timeout on a jasmine-node async spec
本文介绍了如何更改jasmine-node异步规范的超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在不诉诸run / waitsFor块的情况下通过此测试?
How can I get this test to pass without resorting to runs/waitsFor blocks?
it("cannot change timeout", function(done) {
request("http://localhost:3000/hello", function(error, response, body){
expect(body).toEqual("hello world");
done();
});
});
推荐答案
发送此功能的拉取请求( https://github.com/mhevery/jasmine-node/pull/142 )
Sent pull request for this feature (https://github.com/mhevery/jasmine-node/pull/142)
it("cannot change timeout", function(done) {
request("http://localhost:3000/hello", function(error, response, body){
expect(body).toEqual("hello world");
done();
});
}, 5000); // set timeout to 5 seconds
这篇关于如何更改jasmine-node异步规范的超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文