-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
43 lines (42 loc) · 997 Bytes
/
jest.config.js
File metadata and controls
43 lines (42 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/** @type {import('jest').Config} */
const config = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>'],
testMatch: ['**/__tests__/**/*.test.ts', '**/__tests__/**/*.test.tsx'],
testPathIgnorePatterns: [
'/node_modules/',
'/\\.next/',
'/\\.worktrees/',
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
collectCoverageFrom: [
'server/**/*.ts',
'lib/**/*.ts',
'components/**/*.tsx',
'!**/*.d.ts',
'!**/node_modules/**',
'!**/__tests__/**',
],
coverageThreshold: {
global: {
branches: 20,
functions: 20,
lines: 20,
statements: 20,
},
},
// Transform ESM-only modules so Jest can handle them
transformIgnorePatterns: [
'/node_modules/(?!(uuid)/)',
],
transform: {
'^.+\\.tsx?$': 'ts-jest',
'node_modules/uuid/.+\\.js$': 'ts-jest',
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
}
module.exports = config