mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Update _.debounce test to hit code branch.
This commit is contained in:
10
test/test.js
10
test/test.js
@@ -4377,18 +4377,18 @@
|
||||
|
||||
var debounced = _.debounce(function() {
|
||||
++callCount;
|
||||
}, 64, { 'maxWait': 64 });
|
||||
}, 200, { 'maxWait': 200 });
|
||||
|
||||
debounced();
|
||||
|
||||
lodashStable.times(20, function(index) {
|
||||
setTimeout(debounced, 54 + index);
|
||||
});
|
||||
setTimeout(debounced, 190);
|
||||
setTimeout(debounced, 200);
|
||||
setTimeout(debounced, 210);
|
||||
|
||||
setTimeout(function() {
|
||||
assert.strictEqual(callCount, 2);
|
||||
done();
|
||||
}, 160);
|
||||
}, 500);
|
||||
});
|
||||
|
||||
QUnit.test('should cancel `maxDelayed` when `delayed` is invoked', function(assert) {
|
||||
|
||||
Reference in New Issue
Block a user