mirror of
https://github.com/Jackzmc/storage.git
synced 2025-05-10 00:13:20 +00:00
Initial 2
This commit is contained in:
commit
98d0065f55
53 changed files with 5857 additions and 0 deletions
18
web/vitest-setup-client.ts
Normal file
18
web/vitest-setup-client.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import '@testing-library/jest-dom/vitest';
|
||||
import { vi } from 'vitest';
|
||||
|
||||
// required for svelte5 + jsdom as jsdom does not support matchMedia
|
||||
Object.defineProperty(window, 'matchMedia', {
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
value: vi.fn().mockImplementation(query => ({
|
||||
matches: false,
|
||||
media: query,
|
||||
onchange: null,
|
||||
addEventListener: vi.fn(),
|
||||
removeEventListener: vi.fn(),
|
||||
dispatchEvent: vi.fn(),
|
||||
})),
|
||||
})
|
||||
|
||||
// add more mocks here if you need them
|
Loading…
Add table
Add a link
Reference in a new issue