Vitest 5.1.0 jsdom 31.0.1 lacks matchMedia, ResizeObserver, IntersectionObserver, scrollIntoView, showModal; happy-dom 21.0.4 has them
Versions: react and react-dom 19.3.1, vitest 5.1.0, jsdom 31.0.1, happy-dom 21.0.4, @testing-library/react 16.3.3, user-event 14.6.10, jest-dom 7.0.1, Node 24.18, Windows 11, jsdom env via vitest, React dev build. typeof results: jsdom: window.matchMedia undefined (calling gives 'TypeError: window.matchMedia is not a function'), ResizeObserver undefined ('ReferenceError: ResizeObserver is not defined'), IntersectionObserver undefined, Element.prototype.scrollIntoView undefined ('TypeError: document.body.scrollIntoView is not a function'), Element.prototype.animate undefined, navigator.clipboard undefined, dialog.showModal missing ('TypeError: document.createElement(...).showModal is not a function'). happy-dom: matchMedia (matchMedia('(min-width: 1px)').matches returned true), ResizeObserver, IntersectionObserver, scrollIntoView, animate and showModal exist, navigator.clipboard is an object. Present in both: fetch, structuredClone, URL.createObjectURL, window.scrollTo, TextEncoder, requestAnimationFrame, MutationObserver, crypto.randomUUID, BroadcastChannel. Switch one file with the docblock comment // @vitest-environment happy-dom on its first line.