Back to Sinon

clock.runToLast()

docs/concepts/fake-timers/run-to-last.md

22.1.0399 B
Original Source

clock.runToLast() / await clock.runToLastAsync()

This runs all pending timers until the last timer has been fired. If new timers are added while it is executing they will be run as well.

The runToLastAsync() will also break the event loop, allowing any scheduled promise callbacks to execute before running the timers.

<<< ../../.vitepress/tests/docs/fake-timers/api/run-to-last.test.js