The Clock Object
You can modify the browser system clock using the emulate
command. It overrides native global functions related to time allowing them to be controlled synchronously via clock.tick()
or the yielded clock object. This includes controlling:
setTimeout
clearTimeout
setInterval
clearInterval
Date Objects
The clock starts at the unix epoch (timestamp of 0). This means that when you instantiate new Date in your application, it will have a time of January 1st, 1970 if you don't pass any other options to the emulate
command.