diff --git a/src/test-utils/setup-jest.ts b/src/test-utils/setup-jest.ts index a604363..b93e9b1 100644 --- a/src/test-utils/setup-jest.ts +++ b/src/test-utils/setup-jest.ts @@ -15,3 +15,17 @@ if (!global.Worker) { } }; } + +Object.defineProperty(window, 'matchMedia', { + writable: true, + value: (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(), + }), +});