mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Avoiding timing issue with _.debounce test and enable sauce support for backbone tests.
This commit is contained in:
@@ -26,6 +26,14 @@
|
|||||||
<script src="../lodash.js"></script>
|
<script src="../lodash.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var lodash = _.noConflict();
|
var lodash = _.noConflict();
|
||||||
|
|
||||||
|
// assign results to `global_test_results` for Sauce Labs
|
||||||
|
var global_test_results;
|
||||||
|
QUnit.done(function(results) {
|
||||||
|
global_test_results = results;
|
||||||
|
});
|
||||||
|
|
||||||
|
// load Lo-Dash again to overwrite the existing `_` value
|
||||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
delete Object._defineProperty;
|
delete Object._defineProperty;
|
||||||
delete Object._keys;
|
delete Object._keys;
|
||||||
|
|
||||||
// report test results in a global for Sauce Labs
|
// assign results to `global_test_results` for Sauce Labs
|
||||||
var global_test_results;
|
var global_test_results;
|
||||||
QUnit.done(function(results) {
|
QUnit.done(function(results) {
|
||||||
global_test_results = results;
|
global_test_results = results;
|
||||||
|
|||||||
12
test/test.js
12
test/test.js
@@ -1501,7 +1501,7 @@
|
|||||||
withMaxWait();
|
withMaxWait();
|
||||||
withoutMaxWait();
|
withoutMaxWait();
|
||||||
}
|
}
|
||||||
strictEqual(withCount, 1);
|
ok(withCount > 0);
|
||||||
strictEqual(withoutCount, 0);
|
strictEqual(withoutCount, 0);
|
||||||
|
|
||||||
var lastWithCount = withCount,
|
var lastWithCount = withCount,
|
||||||
@@ -6891,10 +6891,14 @@
|
|||||||
stamp,
|
stamp,
|
||||||
count = 0,
|
count = 0,
|
||||||
limit = 100,
|
limit = 100,
|
||||||
options = index ? { 'leading': false } : {},
|
options = index ? { 'leading': false } : {};
|
||||||
throttled = _.throttle(function() { count++; stamp = +new Date; }, 32, options),
|
|
||||||
start = +new Date;
|
|
||||||
|
|
||||||
|
var throttled = _.throttle(function() {
|
||||||
|
count++;
|
||||||
|
stamp = +new Date;
|
||||||
|
}, 32, options);
|
||||||
|
|
||||||
|
var start = +new Date;
|
||||||
while (((now = +new Date) - start) < limit || now == stamp) {
|
while (((now = +new Date) - start) < limit || now == stamp) {
|
||||||
throttled();
|
throttled();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,12 @@
|
|||||||
window._ = lodash;
|
window._ = lodash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// assign results to `global_test_results` for Sauce Labs
|
||||||
|
var global_test_results;
|
||||||
|
QUnit.done(function(results) {
|
||||||
|
global_test_results = results;
|
||||||
|
});
|
||||||
|
|
||||||
// load Lo-Dash again to overwrite the existing `_` value
|
// load Lo-Dash again to overwrite the existing `_` value
|
||||||
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
|
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user