mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 11:57:49 +00:00
Tweak _.now unit test.
This commit is contained in:
19
test/test.js
19
test/test.js
@@ -5429,9 +5429,22 @@
|
|||||||
QUnit.module('lodash.now');
|
QUnit.module('lodash.now');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
test('should return the number of milliseconds that have elapsed since the Unix epoch', 1, function() {
|
asyncTest('should return the number of milliseconds that have elapsed since the Unix epoch', 2, function() {
|
||||||
var actual = _.now();
|
var stamp = +new Date,
|
||||||
ok(new Date - actual < 4);
|
actual = _.now();
|
||||||
|
|
||||||
|
ok(actual >= stamp);
|
||||||
|
|
||||||
|
if (!(isRhino && isModularize)) {
|
||||||
|
setTimeout(function() {
|
||||||
|
ok(_.now() > actual);
|
||||||
|
QUnit.start();
|
||||||
|
}, 32);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
skipTest();
|
||||||
|
QUnit.start();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user