mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Fix _.throttle and _.now tests.
This commit is contained in:
13
test/test.js
13
test/test.js
@@ -5091,7 +5091,8 @@
|
||||
|
||||
(function() {
|
||||
test('should return the number of milliseconds that have elapsed since the Unix epoch', 1, function() {
|
||||
strictEqual(_.now(), +new Date);
|
||||
var actual = _.now();
|
||||
ok(new Date - actual < 4);
|
||||
});
|
||||
}());
|
||||
|
||||
@@ -6918,13 +6919,13 @@
|
||||
var callCount = 0,
|
||||
dateCount = 0;
|
||||
|
||||
var getTime = function() {
|
||||
return ++dateCount < 3 ? +new Date : Infinity;
|
||||
};
|
||||
|
||||
var lodash = _.runInContext(_.assign({}, root, {
|
||||
'Date': function() {
|
||||
return {
|
||||
'getTime': function() {
|
||||
return ++dateCount < 3 ? new Date : Object(Infinity);
|
||||
}
|
||||
};
|
||||
return { 'getTime': getTime, 'valueOf': getTime };
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user