mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Ensure wait of _.debounce and _.throttle defaults to 0. [closes #991]
This commit is contained in:
22
test/test.js
22
test/test.js
@@ -13889,6 +13889,28 @@
|
||||
ok(pass);
|
||||
});
|
||||
|
||||
asyncTest('_.' + methodName + ' should have a default `wait` of `0`', 1, function() {
|
||||
if (!(isRhino && isModularize)) {
|
||||
var callCount = 0;
|
||||
|
||||
var funced = func(function() {
|
||||
callCount++;
|
||||
});
|
||||
|
||||
funced();
|
||||
|
||||
setTimeout(function() {
|
||||
funced();
|
||||
strictEqual(callCount, isDebounce ? 1 : 2);
|
||||
QUnit.start();
|
||||
}, 32);
|
||||
}
|
||||
else {
|
||||
skipTest();
|
||||
QUnit.start();
|
||||
}
|
||||
});
|
||||
|
||||
asyncTest('_.' + methodName + ' should call `func` with the correct `this` binding', 1, function() {
|
||||
if (!(isRhino && isModularize)) {
|
||||
var object = {
|
||||
|
||||
Reference in New Issue
Block a user