From a65594a3cb679ee0d31befa1c9438007d506edbc Mon Sep 17 00:00:00 2001 From: Gareth Jones <3151613+G-Rath@users.noreply.github.com> Date: Fri, 17 Oct 2025 07:55:02 +1300 Subject: [PATCH] docs: add note about mocking `requestAnimationFrame` for transitions --- docs/guide/advanced/transitions.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/guide/advanced/transitions.md b/docs/guide/advanced/transitions.md index 964f992e8..0c7079995 100644 --- a/docs/guide/advanced/transitions.md +++ b/docs/guide/advanced/transitions.md @@ -66,3 +66,9 @@ Potential solutions: - You can create your own transition stub that can handle these hooks if necessary. - You can spy the warning in the test to silence it. ::: + +If you do turn off auto stubbing, note that you might also need to mock `requestAnimationFrame` to ensure that the javascript hooks fire properly: + +```js +vi.spyOn(window, 'requestAnimationFrame').mockImplementation(cb => cb()); +```