module.exports = { preset: 'ts-jest', testEnvironment: 'jsdom', roots: ['/src'], testMatch: ['**/__tests__/**/*.test.{ts,tsx}', '**/*.test.{ts,tsx}'], collectCoverageFrom: [ 'src/**/*.{ts,tsx}', '!src/**/*.d.ts', '!src/**/*.stories.{ts,tsx}', '!src/**/__tests__/**', ], coverageThreshold: { global: { branches: 30, functions: 40, lines: 42, statements: 42, }, }, coverageReporters: ['text', 'lcov', 'html', 'json'], coverageDirectory: 'coverage', moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], moduleNameMapper: { '^@/(.*)$': '/src/$1', }, transform: { '^.+\\.(ts|tsx)$': 'ts-jest', }, transformIgnorePatterns: [ 'node_modules/(?!(nanoid|next-auth|@auth)/)', ], setupFilesAfterEnv: ['/jest.setup.js'], testTimeout: 10000, verbose: true, maxWorkers: '50%', };