mirror of
https://github.com/supabase/supabase.git
synced 2026-10-14 05:39:11 +03:00
fix matchMedia error (#29357)
This commit is contained in:
1 parent
bcb847bbbb
commit
f9c8549609
1 file changed
+14
@@ -7,6 +7,20 @@ import { createDynamicRouteParser } from 'next-router-mock/dist/dynamic-routes'
|
||||
|
||||
export const mswServer = setupServer(...APIMock)
|
||||
|
||||
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(),
|
||||
})),
|
||||
})
|
||||
|
||||
beforeAll(() => {
|
||||
console.log('🤖 Starting MSW Server')
|
||||
|
||||
|
||||
Reference in new issue
Block a user