mirror of
https://github.com/supabase/supabase.git
synced 2026-10-17 23:29:08 +03:00
* Add all missing libraries in the packages/apps. * Add all missing Vitest imports to the tests. * Add some missing exports to ui. * Fix the admonition export. * Fix various minor bugs. * Migrate the ui package to use vitest.
28 lines
693 B
TypeScript
28 lines
693 B
TypeScript
/// <reference types="@testing-library/jest-dom" />
|
|
|
|
import * as matchers from '@testing-library/jest-dom/matchers'
|
|
import { cleanup } from '@testing-library/react'
|
|
import { afterEach, expect, vi } from 'vitest'
|
|
|
|
expect.extend(matchers)
|
|
|
|
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()
|
|
})
|