mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-14 12:47:49 +00:00
Skip setTimout mock test in PhantomJS.
This commit is contained in:
18
test/test.js
18
test/test.js
@@ -309,7 +309,6 @@
|
|||||||
}
|
}
|
||||||
lodashStable = lodashStable.noConflict();
|
lodashStable = lodashStable.noConflict();
|
||||||
}
|
}
|
||||||
lodashStable = lodashStable.runInContext(root);
|
|
||||||
|
|
||||||
/** The `lodash` function to test. */
|
/** The `lodash` function to test. */
|
||||||
var _ = root._ || (root._ = interopRequire(filePath));
|
var _ = root._ || (root._ = interopRequire(filePath));
|
||||||
@@ -4725,14 +4724,19 @@
|
|||||||
QUnit.test('should work with mocked `setTimeout`', function(assert) {
|
QUnit.test('should work with mocked `setTimeout`', function(assert) {
|
||||||
assert.expect(1);
|
assert.expect(1);
|
||||||
|
|
||||||
var pass = false,
|
if (!isPhantom) {
|
||||||
setTimeout = root.setTimeout;
|
var pass = false,
|
||||||
|
setTimeout = root.setTimeout;
|
||||||
|
|
||||||
root.setTimeout = function(func) { func(); };
|
root.setTimeout = function(func) { func(); };
|
||||||
_.delay(function() { pass = true; }, 32);
|
_.delay(function() { pass = true; }, 32);
|
||||||
|
root.setTimeout = setTimeout;
|
||||||
|
|
||||||
assert.ok(pass);
|
assert.ok(pass);
|
||||||
root.setTimeout = setTimeout;
|
}
|
||||||
|
else {
|
||||||
|
skipAssert(assert);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user