Download frontend/src/test/setup.ts from build-small-hackathon/mafia: direct link, hf CLI and curl.
- Browser
- Download file 317 Bytes
-
https://huggingface.co/spaces/build-small-hackathon/mafia/resolve/main/frontend/src/test/setup.ts
- Command line
-
hf download hf://spaces/build-small-hackathon/mafia/frontend/src/test/setup.ts
-
curl -L -o setup.ts https://huggingface.co/spaces/build-small-hackathon/mafia/resolve/main/frontend/src/test/setup.ts
317 Bytes
| import { vi } from 'vitest'; | |
| import { Image } from 'canvas'; | |
| // Provide Image for Phaser to use in headless mode | |
| globalThis.Image = Image as any; | |
| // JSDOM occasionally needs these no-ops | |
| globalThis.scrollTo ||= () => {}; | |
| // Use fake timers to step Phaser's main loop deterministically in tests | |
| vi.useFakeTimers(); | |