mobilizon/tests/unit/specs/mocks/matchMedia.ts

13 lines
303 B
TypeScript
Raw Normal View History

import { vi } from "vitest";
vi.stubGlobal("matchMedia", (query: string) => ({
matches: false,
media: query,
onchange: null,
addListener: vi.fn(), // deprecated
removeListener: vi.fn(), // deprecated
addEventListener: vi.fn(),
removeEventListener: vi.fn(),
dispatchEvent: vi.fn(),
}));