import { vi } from 'vitest' /** Test-only matchMedia stub: every query reports the given `matches` value. */ export function mockMatchMedia(matches: boolean): void { window.matchMedia = vi.fn().mockImplementation((query: string) => ({ matches, media: query, onchange: null, addEventListener: vi.fn(), removeEventListener: vi.fn(), addListener: vi.fn(), removeListener: vi.fn(), dispatchEvent: vi.fn(), })) as unknown as typeof window.matchMedia }