import type { Config } from "jest"; const config: Config = { coverageProvider: "v8", testEnvironment: "jsdom", roots: ["/app", "/lib"], modulePathIgnorePatterns: ["/.worktrees/"], // o teste de fumaça (Playwright) roda com `pnpm test:e2e`, não no Jest testPathIgnorePatterns: ["/node_modules/", "/e2e/"], setupFilesAfterEnv: ["/jest.setup.ts"], moduleNameMapper: { "^@/(.*)$": "/$1", "^.+\\.(css|sass|scss)$": "identity-obj-proxy", "^server-only$": "/lib/__mocks__/server-only.ts", // dublê completo e central: nenhum teste monta um mock parcial de next/navigation "^next/navigation$": "/__mocks__/next/navigation.ts", }, testMatch: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"], transform: { "^.+\\.(ts|tsx)$": [ "ts-jest", { tsconfig: { jsx: "react-jsx", esModuleInterop: true, }, }, ], }, moduleFileExtensions: ["ts", "tsx", "js", "jsx"], testEnvironmentOptions: { customExportConditions: [""], }, }; export default config;