import { initTestDb, closeTestDb } from "../test-utils/db-utils"; declare global { // eslint-disable-next-line no-var var db: import("mongodb").Db; } // Set up global mocks if needed // global.fetch = jest.fn(); beforeEach(async () => { global.db = await initTestDb(); }, 30_000); afterEach(async () => { await closeTestDb(); jest.resetAllMocks(); }); process.env.NODE_ENV = "test";