0.3.2 • Published 4 years ago

timemachine v0.3.2

Weekly downloads
44,100
License
MIT
Repository
github
Last release
4 years ago

timemachine Build Status

Test your time-dependent app by monkey patching the Date function and overriding your system time. Timemachine is compatible with global namespaces, RequireJS, CommonJS and NodeJS.

Installation

Bower

$ bower install timemachine

NPM

$ npm install timemachine

Usage

Config

timemachine.config({
  dateString: 'December 25, 1991 13:12:59'
});

console.log(new Date()); // December 25, 1991 13:12:59
ParameterDescriptionDefault
dateStringDate you want set as a stringThu, 01 Jan 1970 00:00:00 GMT
timestampDate you want set as a timestamp0
differenceTime offset in milliseconds0
tickWhether the system clock should continue tickingfalse
keepTimeWhether the system time should be keptfalse

Reset

timemachine.reset();
console.log(new Date()); // Your real system time
0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

9 years ago

0.2.5

9 years ago

0.2.1

10 years ago

0.1.3

10 years ago

0.1.1

11 years ago