Testing · Middle · Question 8 of 75
What does vi.runAllTimers() do differently from vi.advanceTimersByTime(1000)?
- ✓Correct answer: It runs all pending timers (and timers they schedule) until none are left;
advanceTimersByTimemoves the clock only by the given amount - 2They are the same
- 3
runAllTimersuses the real clock
Explanation
With an endless setInterval, runAllTimers gives up after a limit of iterations - use runOnlyPendingTimers or advance by time.