mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07:49 +00:00
Cleanup web worker unit test.
Former-commit-id: a6b2f450f26eba8cb233cceb5920e7ee69c665f1
This commit is contained in:
17
test/test.js
17
test/test.js
@@ -176,18 +176,19 @@
|
|||||||
asyncTest('supports loading ' + basename + ' in a web worker', function() {
|
asyncTest('supports loading ' + basename + ' in a web worker', function() {
|
||||||
if (Worker) {
|
if (Worker) {
|
||||||
var limit = 1000,
|
var limit = 1000,
|
||||||
start = new Date,
|
start = new Date;
|
||||||
wait = 16;
|
|
||||||
|
|
||||||
setTimeout(function attempt() {
|
var attempt = function() {
|
||||||
var actual = _._VERSION;
|
var actual = _._VERSION;
|
||||||
if ((new Date - start) < limit && typeof actual != 'string') {
|
if ((new Date - start) < limit && typeof actual != 'string') {
|
||||||
setTimeout(attempt, wait);
|
setTimeout(attempt, 16);
|
||||||
} else {
|
return;
|
||||||
equal(actual, _.VERSION);
|
|
||||||
QUnit.start();
|
|
||||||
}
|
}
|
||||||
}, wait);
|
equal(actual, _.VERSION);
|
||||||
|
QUnit.start();
|
||||||
|
};
|
||||||
|
|
||||||
|
attempt();
|
||||||
} else {
|
} else {
|
||||||
skipTest();
|
skipTest();
|
||||||
QUnit.start();
|
QUnit.start();
|
||||||
|
|||||||
Reference in New Issue
Block a user