14 lines
338 B
TypeScript
14 lines
338 B
TypeScript
|
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()
|
||
|
}))
|
||
|
});
|