/** @type {import('jest').Config} */ export default { preset: "ts-jest/presets/default-esm", testEnvironment: "node", extensionsToTreatAsEsm: [".ts"], moduleNameMapper: { "^(\\.{1,2}/.*)\\.js$": "$1", }, transform: { "^.+\\.tsx?$": [ "ts-jest", { useESM: true, isolatedModules: true, }, ], }, setupFilesAfterEnv: ["/jest.setup.ts"], testMatch: ["**/__tests__/**/*.test.ts"], moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], testTimeout: 10000, maxWorkers: 1, // Run tests serially to avoid worker issues testEnvironmentOptions: { url: "http://localhost", // Provide a base URL for tests }, };