jest-date-mock
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -11,2 +11,3 @@ "use strict"; | ||
// undefined means unmock. | ||
var DEFAULT = undefined; | ||
@@ -22,3 +23,3 @@ | ||
var advanceBy = exports.advanceBy = function advanceBy(ms) { | ||
return nowDate += ms || 0; | ||
return nowDate = (nowDate === undefined ? +new Date() : nowDate) + (ms || 0); | ||
}; | ||
@@ -25,0 +26,0 @@ |
@@ -7,3 +7,3 @@ /** | ||
*/ | ||
export declare function advanceBy(ms: number): void; | ||
export declare function advanceBy(ms?: number): void; | ||
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
export declare function advanceTo(ms?: number | Date): void; | ||
export declare function advanceTo(ms?: number | Date | string): void; | ||
@@ -19,0 +19,0 @@ /** |
@@ -42,2 +42,2 @@ 'use strict'; | ||
var version = exports.version = '1.0.5'; | ||
var version = exports.version = '1.0.7'; |
@@ -11,2 +11,3 @@ 'use strict'; | ||
var mockDateClass = exports.mockDateClass = function mockDateClass(D) { | ||
// if undefined, use real date, or else mock date | ||
var mockNow = function mockNow() { | ||
@@ -13,0 +14,0 @@ return (0, _date.now)() === undefined ? D.now() : (0, _date.now)(); |
{ | ||
"name": "jest-date-mock", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Mock `window.Date` when run unit test cases with jest. Make tests of `Date` easier.", | ||
@@ -8,3 +8,3 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"test": "jest", | ||
"test": "jest --no-cache", | ||
"build": "babel src --out-dir lib --copy-files && npm run test", | ||
@@ -11,0 +11,0 @@ "coveralls": "cat ./coverage/lcov.info | coveralls" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8051
133