mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +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() {
|
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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user