Spaces:
Sleeping
Sleeping
Download tests/setup.ts from mfuntowicz/hfinfer: direct link, hf CLI and curl.
- Browser
- Download file 626 Bytes
-
https://huggingface.co/spaces/mfuntowicz/hfinfer/resolve/main/tests/setup.ts
- Command line
-
hf download hf://spaces/mfuntowicz/hfinfer/tests/setup.ts
-
curl -L -o setup.ts https://huggingface.co/spaces/mfuntowicz/hfinfer/resolve/main/tests/setup.ts
626 Bytes
| import '@testing-library/jest-dom/vitest' | |
| import { afterEach } from 'vitest' | |
| import { cleanup } from '@testing-library/svelte' | |
| // Vitest runs without `globals: true`, so @testing-library cannot register its | |
| // own auto-cleanup — do it explicitly so renders never leak between tests. | |
| afterEach(() => { | |
| cleanup() | |
| }) | |
| // jsdom has no ResizeObserver — chart components use it for width measurement. | |
| class ResizeObserverStub { | |
| observe(): void {} | |
| unobserve(): void {} | |
| disconnect(): void {} | |
| } | |
| if (!('ResizeObserver' in globalThis)) { | |
| ;(globalThis as { ResizeObserver?: unknown }).ResizeObserver = ResizeObserverStub | |
| } | |