From b48e886674b7ed9c5fe9a176f42c83d8381ee198 Mon Sep 17 00:00:00 2001 From: Adam Gastineau Date: Fri, 6 Dec 2024 11:25:34 -0800 Subject: [PATCH] docs: #33837 Clarify that clock.install must precede clock operations --- docs/src/clock.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/src/clock.md b/docs/src/clock.md index 2f846e4fd3..8c824eb264 100644 --- a/docs/src/clock.md +++ b/docs/src/clock.md @@ -34,6 +34,10 @@ The recommended approach is to use `setFixedTime` to set the time to a specific - `Event.timeStamp` ::: +:::warning +If you call `install` at any point in your test, the call _MUST_ occur before any other clock related calls (see note above for list). For example, you cannot call `setInterval`, followed by `install`, then `clearInterval`, as `install` overrides the native definition of the clock functions. +::: + ## Test with predefined time Often you only need to fake `Date.now` while keeping the timers going.