lolex useful for testing, extract from
Sinon.JS helps to fake timer:
Along with a clock instance that controls the flow of time. Lolex also provides a
Date implementation that gets its time from the clock.
In addition in browser environment lolex provides a
performance implementation that gets its time from the clock. In Node environments lolex provides a
nextTick implementation that is synchronized with the clock - and a
process.hrtime shim that works with the clock.
npm install lolex
1 2 3 4 5 6 7 8 9 10