Spaces:
Sleeping
Sleeping
| /** | |
| * Vitest Setup File | |
| * Konfiguration für Test-Umgebung | |
| */ | |
| // Global test setup | |
| import { vi } from 'vitest' | |
| // Mock window.matchMedia (für responsive Components) | |
| Object.defineProperty(window, 'matchMedia', { | |
| writable: true, | |
| value: vi.fn().mockImplementation(query => ({ | |
| matches: false, | |
| media: query, | |
| onchange: null, | |
| addListener: vi.fn(), | |
| removeListener: vi.fn(), | |
| addEventListener: vi.fn(), | |
| removeEventListener: vi.fn(), | |
| dispatchEvent: vi.fn(), | |
| })), | |
| }) | |
| // Mock IntersectionObserver | |
| global.IntersectionObserver = class IntersectionObserver { | |
| constructor() {} | |
| disconnect() {} | |
| observe() {} | |
| takeRecords() { | |
| return [] | |
| } | |
| unobserve() {} | |
| } | |
| // Mock ResizeObserver | |
| global.ResizeObserver = class ResizeObserver { | |
| constructor() {} | |
| disconnect() {} | |
| observe() {} | |
| unobserve() {} | |
| } | |
| // Suppress console errors in tests (optional) | |
| // global.console.error = vi.fn() | |
| // global.console.warn = vi.fn() | |