mirror of
https://git.unlock-music.dev/um/um-react.git
synced 2024-11-23 20:42:17 +00:00
test: mock matchMedia
This commit is contained in:
parent
0c4b7f4048
commit
9abd73b212
@ -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(),
|
||||
}),
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user