// Global test setup import mongoose from 'mongoose'; import { jest, afterAll } from '@jest/globals'; // Increase timeout for tests jest.setTimeout(30000); // Silence console logs during tests global.console = { ...console, log: jest.fn(), info: jest.fn(), debug: jest.fn(), // Keep error and warn for debugging error: console.error, warn: console.warn, }; // Clean up after all tests afterAll(async () => { // Close mongoose connection if open if (mongoose.connection.readyState !== 0) { await mongoose.disconnect(); } });