mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 08:37:49 +00:00
Avoiding timing issue with _.debounce test and enable sauce support for backbone tests.
This commit is contained in:
12
test/test.js
12
test/test.js
@@ -1501,7 +1501,7 @@
|
||||
withMaxWait();
|
||||
withoutMaxWait();
|
||||
}
|
||||
strictEqual(withCount, 1);
|
||||
ok(withCount > 0);
|
||||
strictEqual(withoutCount, 0);
|
||||
|
||||
var lastWithCount = withCount,
|
||||
@@ -6891,10 +6891,14 @@
|
||||
stamp,
|
||||
count = 0,
|
||||
limit = 100,
|
||||
options = index ? { 'leading': false } : {},
|
||||
throttled = _.throttle(function() { count++; stamp = +new Date; }, 32, options),
|
||||
start = +new Date;
|
||||
options = index ? { 'leading': false } : {};
|
||||
|
||||
var throttled = _.throttle(function() {
|
||||
count++;
|
||||
stamp = +new Date;
|
||||
}, 32, options);
|
||||
|
||||
var start = +new Date;
|
||||
while (((now = +new Date) - start) < limit || now == stamp) {
|
||||
throttled();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user