From 7351227c7210f405391ceec81b391bdea7468009 Mon Sep 17 00:00:00 2001 From: Jason O'Neill Date: Sat, 13 May 2023 20:11:50 +0000 Subject: [PATCH] Add docs for clock.jump method --- docs/release-source/release/fake-timers.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/release-source/release/fake-timers.md b/docs/release-source/release/fake-timers.md index aee05bbb2..a7f8d192b 100644 --- a/docs/release-source/release/fake-timers.md +++ b/docs/release-source/release/fake-timers.md @@ -150,6 +150,13 @@ Causes all timers scheduled within the affected time range to be called. `time` The `tickAsync()` will also break the event loop, allowing any scheduled promise callbacks to execute _before_ running the timers. +#### `clock.jump(time);` + +Advance the clock by jumping forward in time, firing callbacks at most once. +`time` takes the same formats as [`clock.tick`](#clockticktime--await-clocktickasynctime). + +This can be used to simulate the JS engine (such as a browser) being put to sleep and resumed later, skipping intermediary timers. + #### `clock.next();` / `await clock.nextAsync()` Advances the clock to the the moment of the first scheduled timer, firing it.