mafia / frontend /src /test /setup.ts
Alfaxad's picture
Migrate Mafia game to ZeroGPU Gradio Space
c670567 verified
Raw
History Blame Contribute Delete
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();