This repository has been archived by the owner. It is now read-only.

this.timeout has no effect in setUp (Was "Setting up a different timeout setting (other than the default 250)") #199

Closed
KidkArolis opened this Issue Jun 19, 2012 · 6 comments

Comments

Projects
None yet
3 participants
@KidkArolis

KidkArolis commented Jun 19, 2012

How do I do that?
I saw you can do that if you create a custom test runner, but I couldn't figure out how..

@magnars

This comment has been minimized.

Member

magnars commented Jun 19, 2012

In your test or setUp-function:

this.timeout = 1000;
@KidkArolis

This comment has been minimized.

KidkArolis commented Jun 19, 2012

Thanks, that worked. However, I think the timeout configured this way only applies to the test functions. The setUp and tearDown functions still have 250ms timeout. Shouldn't setUp and tearDown functions use the same timeout option?

@cjohansen

This comment has been minimized.

Member

cjohansen commented Jun 19, 2012

It should as long as you use this.timeout. You can also set it globally with buster.testRunner.timeout = xxx

@KidkArolis

This comment has been minimized.

KidkArolis commented Jun 20, 2012

So is setting it globally the only way to change timeout for prepare/setUp functions?

I wanted something like this, but the timeout of 500 would only be applied to the test function. Prepare times out in 250, as I guess I'm not configuring the timeout early enough.

buster.testCase("My thing", {

  prepare: function (done) {
    this.timeout = 500;
    setTimeout(done, 400);
  },

  "times out after 500": function (done) {
    functionThatTakesForever(done);
  }
});


My thing: 
Uncaught exception!
    TimeoutError: My thing prepare(n) timed out: Timed out after 250ms
@cjohansen

This comment has been minimized.

Member

cjohansen commented Jun 20, 2012

Looks like you found a bug!

@ghost ghost assigned cjohansen Jul 6, 2012

@cjohansen

This comment has been minimized.

Member

cjohansen commented Jul 9, 2012

@cjohansen cjohansen closed this Jul 9, 2012

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.