6ev4uk / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

New Convenience Method on Callbacks: Timeout #330

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is a really minor request, but I think it'd be nice to have.

What steps will reproduce the current situation?
1. You create an Async test case
2. You want a step to trigger after waiting Xms
3. You write window.setTimeout(callbacks.noop(), X);

What would you prefer?
1. You create an Async test case
2. You want a step to trigger after waiting Xms
3. You write callbacks.timeout(X);

Two reasons for this request:
1) The code is cleaner
2) Trying to use small timeouts (eg. 1) doesn't work with the AsyncTestCase 
system.  By having a method for this operation you could enforce a minimum 
timeout (ie. X = min(500, X)), and explain the issue to the user in the 
documentation of timeout.

Original issue reported on code.google.com by jer...@syapse.com on 31 Jan 2012 at 11:11