🚀 Feature Request
A paused option on page.clock.install() that installs fake timers with the clock already frozen, so no follow-up pauseAt() call with a guessed future timestamp is needed.
Example
await page.clock.install({ time: START, paused: true });
Replaces the current two-step workaround, where the pause target has to be a guessed timestamp ahead of the install time to avoid cannot fast forward to the past:
await page.clock.install({ time: START });
await page.clock.pauseAt(PAUSE); // must be > START by more than the setup drift
Motivation
install() not freezing is surprising — sinon and jest freeze by default, so time silently keeps running and you suspect your own code first. The workaround is also fragile: install({ time: T }) followed by pauseAt(T) intermittently throws cannot fast forward to the past, because real time drifts forward between the two calls. That forces you to pick an arbitrary later timestamp — too close and it flakes, too far and it silently eats into the window you're asserting on.
A paused option removes the second call entirely, so there's no timestamp to guess and no drift to race.
🚀 Feature Request
A paused option on
page.clock.install()that installs fake timers with the clock already frozen, so no follow-uppauseAt()call with a guessed future timestamp is needed.Example
await page.clock.install({ time: START, paused: true });Replaces the current two-step workaround, where the pause target has to be a guessed timestamp ahead of the install time to avoid cannot fast forward to the past:
await page.clock.install({ time: START });await page.clock.pauseAt(PAUSE); // must be > START by more than the setup driftMotivation
install()not freezing is surprising — sinon and jest freeze by default, so time silently keeps running and you suspect your own code first. The workaround is also fragile:install({ time: T })followed bypauseAt(T)intermittently throws cannot fast forward to the past, because real time drifts forward between the two calls. That forces you to pick an arbitrary later timestamp — too close and it flakes, too far and it silently eats into the window you're asserting on.A paused option removes the second call entirely, so there's no timestamp to guess and no drift to race.