Allow clearTimeout, setTimeout, and Date.now to be mocked.

This commit is contained in:
John-David Dalton
2016-05-18 13:47:35 -07:00
parent b56c732332
commit 84b8ee7bda

View File

@@ -1288,13 +1288,13 @@
Reflect = context.Reflect, Reflect = context.Reflect,
Symbol = context.Symbol, Symbol = context.Symbol,
Uint8Array = context.Uint8Array, Uint8Array = context.Uint8Array,
clearTimeout = context.clearTimeout, clearTimeout = function(id) { return context.clearTimeout.call(root, id); },
enumerate = Reflect ? Reflect.enumerate : undefined, enumerate = Reflect ? Reflect.enumerate : undefined,
getOwnPropertySymbols = Object.getOwnPropertySymbols, getOwnPropertySymbols = Object.getOwnPropertySymbols,
iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined, iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined,
objectCreate = Object.create, objectCreate = Object.create,
propertyIsEnumerable = objectProto.propertyIsEnumerable, propertyIsEnumerable = objectProto.propertyIsEnumerable,
setTimeout = context.setTimeout, setTimeout = function(func, wait) { return context.setTimeout.call(root, func, wait); },
splice = arrayProto.splice; splice = arrayProto.splice;
/* Built-in method references for those with the same name as other `lodash` methods. */ /* Built-in method references for those with the same name as other `lodash` methods. */
@@ -9254,7 +9254,6 @@
* @static * @static
* @memberOf _ * @memberOf _
* @since 2.4.0 * @since 2.4.0
* @type {Function}
* @category Date * @category Date
* @returns {number} Returns the timestamp. * @returns {number} Returns the timestamp.
* @example * @example
@@ -9264,7 +9263,9 @@
* }, _.now()); * }, _.now());
* // => Logs the number of milliseconds it took for the deferred function to be invoked. * // => Logs the number of milliseconds it took for the deferred function to be invoked.
*/ */
var now = Date.now; function now() {
return Date.now();
}
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/