Skip to content

Commit

Permalink
Add docs for clock.jump method (#2512)
Browse files Browse the repository at this point in the history
  • Loading branch information
CreativeTechGuy authored May 15, 2023
1 parent fb6e695 commit b2a4df5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/release-source/release/fake-timers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b2a4df5

Please sign in to comment.