mirror of
https://github.com/Choices-js/Choices.git
synced 2026-03-15 15:15:46 +01:00
17 lines
455 B
TypeScript
17 lines
455 B
TypeScript
import { beforeAll } from 'vitest';
|
|
|
|
beforeAll(() => {
|
|
Object.defineProperty(globalThis.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(),
|
|
})),
|
|
});
|
|
});
|