Spaces:
Sleeping
Sleeping
Download frontend/src/test/setup.ts from vn6295337/Instant-SWOT-Agent: direct link, hf CLI and curl.
- Browser
- Download file 867 Bytes
-
https://huggingface.co/spaces/vn6295337/Instant-SWOT-Agent/resolve/main/frontend/src/test/setup.ts
- Command line
-
hf download hf://spaces/vn6295337/Instant-SWOT-Agent/frontend/src/test/setup.ts
-
curl -L -o setup.ts https://huggingface.co/spaces/vn6295337/Instant-SWOT-Agent/resolve/main/frontend/src/test/setup.ts
867 Bytes
| import '@testing-library/jest-dom' | |
| import { cleanup } from '@testing-library/react' | |
| import { afterEach, vi } from 'vitest' | |
| // Cleanup after each test | |
| afterEach(() => { | |
| cleanup() | |
| }) | |
| // Mock window.matchMedia | |
| Object.defineProperty(window, 'matchMedia', { | |
| writable: true, | |
| value: vi.fn().mockImplementation((query: string) => ({ | |
| matches: false, | |
| media: query, | |
| onchange: null, | |
| addListener: vi.fn(), | |
| removeListener: vi.fn(), | |
| addEventListener: vi.fn(), | |
| removeEventListener: vi.fn(), | |
| dispatchEvent: vi.fn(), | |
| })), | |
| }) | |
| // Mock ResizeObserver | |
| global.ResizeObserver = vi.fn().mockImplementation(() => ({ | |
| observe: vi.fn(), | |
| unobserve: vi.fn(), | |
| disconnect: vi.fn(), | |
| })) | |
| // Mock IntersectionObserver | |
| global.IntersectionObserver = vi.fn().mockImplementation(() => ({ | |
| observe: vi.fn(), | |
| unobserve: vi.fn(), | |
| disconnect: vi.fn(), | |
| })) | |