ファイル
btrc-hub/frontend/src/test/setup.ts
T
みてるぞ f5b632ed89 設定画面 (#34) (#397)
Reviewed-on: #397
Co-authored-by: miteruzo <miteruzo@naver.com>
Co-committed-by: miteruzo <miteruzo@naver.com>
2026-07-07 00:48:41 +09:00

30 行
586 B
TypeScript

import '@testing-library/jest-dom/vitest'
import { cleanup } from '@testing-library/react'
import { afterEach, vi } from 'vitest'
afterEach (() => {
cleanup ()
localStorage.clear ()
vi.restoreAllMocks ()
})
Element.prototype.scrollIntoView = function () {
;
}
window.scroll = function () {
;
}
window.requestAnimationFrame = callback => {
callback (0)
return 0
}
Object.defineProperty (window, 'matchMedia', {
configurable: true,
value: vi.fn ().mockImplementation (() => ({
addEventListener: vi.fn (),
removeEventListener: vi.fn (),
matches: false })) })