Update _.debounce test to hit code branch.

This commit is contained in:
John-David Dalton
2016-08-10 13:13:12 -07:00
parent 7da7d7b7e0
commit 14fb27ce77

View File

@@ -4377,18 +4377,18 @@
var debounced = _.debounce(function() { var debounced = _.debounce(function() {
++callCount; ++callCount;
}, 64, { 'maxWait': 64 }); }, 200, { 'maxWait': 200 });
debounced(); debounced();
lodashStable.times(20, function(index) { setTimeout(debounced, 190);
setTimeout(debounced, 54 + index); setTimeout(debounced, 200);
}); setTimeout(debounced, 210);
setTimeout(function() { setTimeout(function() {
assert.strictEqual(callCount, 2); assert.strictEqual(callCount, 2);
done(); done();
}, 160); }, 500);
}); });
QUnit.test('should cancel `maxDelayed` when `delayed` is invoked', function(assert) { QUnit.test('should cancel `maxDelayed` when `delayed` is invoked', function(assert) {