Merge pull request #232 from CatChen/master

Use setTimeout to verify _.delay's behavior in unit test
This commit is contained in:
Jeremy Ashkenas
2011-06-20 15:43:22 -07:00

View File

@@ -73,8 +73,8 @@ $(document).ready(function() {
asyncTest("functions: delay", 2, function() {
var delayed = false;
_.delay(function(){ delayed = true; }, 100);
_.delay(function(){ ok(!delayed, "didn't delay the function quite yet"); }, 50);
_.delay(function(){ ok(delayed, 'delayed the function'); start(); }, 150);
setTimeout(function(){ ok(!delayed, "didn't delay the function quite yet"); }, 50);
setTimeout(function(){ ok(delayed, 'delayed the function'); start(); }, 150);
});
asyncTest("functions: defer", 1, function() {