timekeeper
Advanced tools
Comparing version 0.0.2 to 0.0.3
0.0.2 / 2012-04-01 | ||
0.0.3 / 2012-08-08 | ||
================== | ||
* Only replace Date with FakeDate when timekeeper is enabled. | ||
0.0.2 / 2012-04-01 | ||
================== | ||
* rename ms to time to avoid namespace conflict | ||
* make sure the instanceof Date still returns true |
@@ -15,3 +15,2 @@ /** | ||
/** | ||
@@ -125,2 +124,4 @@ * `TimeKeeper`. | ||
timekeeper.freeze = function(date) { | ||
useFakeDate(); | ||
if (typeof date !== 'object') { | ||
@@ -140,2 +141,4 @@ date = new NativeDate(date); | ||
timekeeper.travel = function(date) { | ||
useFakeDate(); | ||
if (typeof date !== 'object') { | ||
@@ -155,2 +158,3 @@ date = new NativeDate(date); | ||
timekeeper.reset = function() { | ||
useNativeDate(); | ||
freeze = null; | ||
@@ -164,7 +168,17 @@ started = null; | ||
*/ | ||
Date = FakeDate; | ||
function useFakeDate() { | ||
Date = FakeDate | ||
} | ||
/** | ||
* Restore the `Date` to `NativeDate`. | ||
*/ | ||
function useNativeDate() { | ||
Date = NativeDate | ||
} | ||
/** | ||
* Expose `timekeeper` | ||
*/ | ||
module.exports = timekeeper; |
{ | ||
"name": "timekeeper" | ||
, "description": "Easy testing of time-dependent code." | ||
, "version": "0.0.2" | ||
, "version": "0.0.3" | ||
, "keywords": ["fake date", "date test", "mocking date"] | ||
@@ -6,0 +6,0 @@ , "author": "Veselin Todorov <hi@vesln.com>" |
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
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
9372
234
1