如何更改 jasmine-node 异步规范的超时 [英] How do I change the timeout on a jasmine-node async spec

查看:15
本文介绍了如何更改 jasmine-node 异步规范的超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不使用 runs/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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆