You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix tests broken by Vitest v4 and React 19 upgrades
Vitest v4 changed how vi.fn() handles `new` calls: when a mock has an
arrow-function implementation, calling it with `new` now routes through
Reflect.construct which rejects arrow functions as constructors. Replace
all arrow-function implementations in Image mocks with regular functions.
Also fix the duplicate-script-prevention test: in Vitest v4, vi.spyOn on
an already-spied method returns the same spy object (shared call history),
so the previous appendSpy approach incorrectly counted pre-existing calls.
Replaced with mockClear() + re-check on the original spy.
0 commit comments