36 lines
906 B
JavaScript
36 lines
906 B
JavaScript
module.exports = {
|
|
preset: 'ts-jest',
|
|
testEnvironment: 'jsdom',
|
|
roots: ['<rootDir>/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: 20,
|
|
functions: 25,
|
|
lines: 25,
|
|
statements: 25,
|
|
},
|
|
},
|
|
coverageReporters: ['text', 'lcov', 'html', 'json'],
|
|
coverageDirectory: 'coverage',
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
moduleNameMapper: {
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
|
},
|
|
transform: {
|
|
'^.+\\.(ts|tsx)$': 'ts-jest',
|
|
},
|
|
transformIgnorePatterns: [
|
|
'node_modules/(?!(nanoid|next-auth|@auth)/)',
|
|
],
|
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
|
testTimeout: 10000,
|
|
verbose: true,
|
|
maxWorkers: '50%',
|
|
}; |