Skip to content

Commit 6c97ffd

Browse files
brkalowclaude
andcommitted
fix(repo): Mock base @formkit/auto-animate module in vitest setup
The base auto-animate module has side effects (setInterval/setTimeout that call requestAnimationFrame) which fire after jsdom environment teardown, causing 2 uncaught ReferenceError exceptions in @clerk/ui tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 56d07ec commit 6c97ffd

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/clerk-js/vitest.setup.mts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ vi.mock('@formkit/auto-animate/react', () => ({
269269
useAutoAnimate: () => [null],
270270
}));
271271

272+
// Also mock the base module to prevent its side effects (setInterval/setTimeout
273+
// that call requestAnimationFrame) from firing after jsdom environment teardown.
274+
vi.mock('@formkit/auto-animate', () => ({
275+
default: () => ({ enable: () => {}, disable: () => {}, destroy: () => {} }),
276+
}));
277+
272278
// Mock browser-tabs-lock to prevent window access errors in tests
273279
vi.mock('browser-tabs-lock', () => {
274280
return {

0 commit comments

Comments
 (0)