1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2025-02-13 12:14:35 +00:00
mobilizon/tests/unit/specs/mocks/matchMedia.ts
Thomas Citharel 2e72f6faf4
build: switch from yarn to npm to manage js dependencies and move js contents to root
yarn v1 is being deprecated and starts to have some issues

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2023-11-14 17:24:42 +01:00

12 lines
303 B
TypeScript

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(),
}));