Download src/tests/setup.ts from AUXteam/Bentopdf: direct link, hf CLI and curl.
- Browser
- Download file 727 Bytes
-
https://huggingface.co/spaces/AUXteam/Bentopdf/resolve/main/src/tests/setup.ts
- Command line
-
hf download hf://spaces/AUXteam/Bentopdf/src/tests/setup.ts
-
curl -L -o setup.ts https://huggingface.co/spaces/AUXteam/Bentopdf/resolve/main/src/tests/setup.ts
727 Bytes
| import { afterEach, vi } from 'vitest'; | |
| afterEach(() => { | |
| document.body.innerHTML = ''; | |
| document.head.innerHTML = ''; | |
| }); | |
| global.ResizeObserver = vi.fn().mockImplementation(() => ({ | |
| observe: vi.fn(), | |
| unobserve: vi.fn(), | |
| disconnect: vi.fn(), | |
| })); | |
| 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(), | |
| })), | |
| }); | |
| global.IntersectionObserver = vi.fn().mockImplementation(() => ({ | |
| observe: vi.fn(), | |
| unobserve: vi.fn(), | |
| disconnect: vi.fn(), | |
| })); | |