import type { Config } from "jest"; import nextJest from "next/jest.js"; // Point Next's Jest transformer at the app root so next.config + .env + SWC // transforms (TS/JSX, path aliases) are wired up automatically. const createJestConfig = nextJest({ dir: "./" }); const config: Config = { testEnvironment: "jest-environment-jsdom", setupFilesAfterEnv: ["/jest.setup.ts"], // Resolve the `@/*` path alias from tsconfig. moduleNameMapper: { "^@/(.*)$": "/src/$1", }, testMatch: ["/src/**/*.test.ts", "/src/**/*.test.tsx"], // Only the pure helper modules are meaningful to cover; 3D/canvas/scroll // components are excluded from coverage (untestable under jsdom). collectCoverageFrom: [ "src/components/strategy/theme.ts", "src/components/optimization/math.ts", "src/components/optimization/constants.ts", "src/components/logisticsbrain/math.ts", ], }; export default createJestConfig(config);