/** @type {import('jest').Config} */ const config = { preset: 'ts-jest', testEnvironment: 'node', roots: ['/__tests__'], testMatch: ['**/*.test.ts'], moduleNameMapper: { '^@/(.*)$': '/$1', }, transform: { '^.+\\.tsx?$': [ 'ts-jest', { tsconfig: 'tsconfig.json', }, ], }, collectCoverageFrom: [ 'lib/**/*.ts', '!lib/**/*.d.ts', '!lib/**/types.ts', ], coverageDirectory: 'coverage', coverageReporters: ['text', 'lcov', 'html', 'json-summary'], coverageThreshold: { global: { branches: 80, functions: 80, lines: 80, statements: 80, }, }, setupFilesAfterEnv: ['/__tests__/setup.ts'], testPathIgnorePatterns: ['/node_modules/', '/.next/', '/cypress/'], verbose: true, // Increase timeout for async tests testTimeout: 10000, }; module.exports = config;