import { beforeEach, afterEach, vi } from 'vitest'; // Reset mocks between tests beforeEach(() => { vi.clearAllMocks(); }); // Clean up after each test afterEach(() => { vi.restoreAllMocks(); }); // Global test timeout vi.setConfig({ testTimeout: 10000 }); // Silence console during tests unless DEBUG=true if (process.env.DEBUG !== 'true') { global.console = { ...console, log: vi.fn(), debug: vi.fn(), info: vi.fn(), warn: vi.fn(), error: vi.fn(), }; }