/** * Jest for apps/api. * * `pnpm test` existed in package.json from the start but jest was never a * dependency, so the script always failed. Added during security-hotfix stage 2 * with the user's approval, dev-only. * * Unit tests live next to the code as *.spec.ts. The live-server integration * checks stay in scripts/auth-smoke.sh — they need a running API and a seeded * database, which is a different thing from a unit run. */ module.exports = { preset: 'ts-jest', testEnvironment: 'node', rootDir: 'src', testRegex: '.*\\.spec\\.ts$', moduleFileExtensions: ['js', 'json', 'ts'], transform: { '^.+\\.ts$': ['ts-jest', { tsconfig: '/../tsconfig.json' }], }, collectCoverageFrom: ['**/*.ts', '!**/*.spec.ts', '!**/*.module.ts'], };