Skip to content

Commit

Permalink
tweaking docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreardon committed Oct 3, 2023
1 parent 95a3861 commit e21c9ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/TimerMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ it('calls the callback after 1 second via advanceTimersByTime', () => {

Lastly, it may occasionally be useful in some tests to be able to clear all of the pending timers. For this, we have `jest.clearAllTimers()`.

## Advance Timers by frame
## Advance Timers by Frame

In applications, often you want to schedule work inside of an animation frame (via `requestAnimationFrame`). We expose a convenance method `jest.runToFrame()` to advance all timers enough to execute all actively scheduled animation frames.
In applications, often you want to schedule work inside of an animation frame (via `requestAnimationFrame`). We expose a convenance method `jest.runToFrame()` to advance all timers enough milliseconds to execute all actively scheduled animation frames.

```javascript
jest.useFakeTimers();
Expand Down

0 comments on commit e21c9ca

Please sign in to comment.