Function When_I_use_fake_timers

  • When I use fake timers:

    When I use fake timers
    

    Returns void

    Enable fake timers and set system time to Unix epoch:

    When I use fake timers
    

    Overrides native global functions related to time allowing them to be controlled synchronously. This includes controlling:

    • setTimeout
    • clearTimeout
    • setInterval
    • clearInterval
    • Date

    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.