Files
supabase/packages/ui/vitest.setup.ts
Ivan Vasilov 06aa80e9f0 chore: Bump next to non-vulnerable version (#31277)
* Add next to pnpm catalog and use that next version from all apps and packages.

* Remove vite direct dependency.

* Set the @types/node to version 20.

* Stabilize supports-color by adding it in the main package.json. This will make it appear in all packages that have it as optional.

* Use built-in matchers for vitest in @testing-library/jest-dom.

* Add libpg-query as a dependency to docs.

* Remove nextjs-node-loader for the built-in external packages feature on nextjs.

* Clean up extra comment.
2025-01-03 13:25:00 +01:00

26 lines
639 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(),
})),
})
vi.mock('next/navigation', () => require('next-router-mock'))
afterEach(() => {
cleanup()
})