mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
Sorted all imports in all packages, `cms`, `design-system` and `ui-library` apps by running `pnpm format` on them. All changes in this PR are done by the script.
36 lines
859 B
TypeScript
36 lines
859 B
TypeScript
/// <reference types="@testing-library/jest-dom" />
|
|
import '@testing-library/jest-dom/vitest'
|
|
|
|
import { cleanup } from '@testing-library/react'
|
|
import { afterEach, vi } from 'vitest'
|
|
|
|
Object.defineProperty(window, 'matchMedia', {
|
|
writable: true,
|
|
value: vi.fn().mockImplementation((query) => ({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addListener: vi.fn(), // deprecated
|
|
removeListener: vi.fn(), // deprecated
|
|
addEventListener: vi.fn(),
|
|
removeEventListener: vi.fn(),
|
|
dispatchEvent: vi.fn(),
|
|
})),
|
|
})
|
|
|
|
// Mock ResizeObserver
|
|
global.ResizeObserver = vi.fn().mockImplementation(() => ({
|
|
observe: vi.fn(),
|
|
unobserve: vi.fn(),
|
|
disconnect: vi.fn(),
|
|
}))
|
|
|
|
// Mock scrollIntoView
|
|
Element.prototype.scrollIntoView = vi.fn()
|
|
|
|
vi.mock('next/navigation', () => require('next-router-mock'))
|
|
|
|
afterEach(() => {
|
|
cleanup()
|
|
})
|