f5b632ed89
Reviewed-on: #397 Co-authored-by: miteruzo <miteruzo@naver.com> Co-committed-by: miteruzo <miteruzo@naver.com>
30 行
586 B
TypeScript
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 })) })
|