forked from ricsf2000/VolunteerEngine
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
58 lines (49 loc) · 1.22 KB
/
Copy pathjest.config.js
File metadata and controls
58 lines (49 loc) · 1.22 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: [
'**/__tests__/**/*.test.{js,ts}',
'**/*.test.{js,ts}'
],
collectCoverageFrom: [
'src/app/api/**/*.ts',
'src/app/lib/**/*.ts',
'src/auth.ts',
'src/middleware.ts',
'!**/*.d.ts', // Exclude type definitions
'!**/node_modules/**', // Exclude dependencies
],
coverageThreshold: {
global: {
statements: 80,
branches: 80,
functions: 80,
lines: 80
}
},
coverageDirectory: 'coverage',
coverageReporters: [
'text',
'lcov',
'html'
],
transform: {
'^.+\\.ts$': 'ts-jest',
},
// Transform ignore patterns for ESM modules
transformIgnorePatterns: [
'node_modules/(?!(next-auth)/)'
],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^next-auth$': '<rootDir>/__mocks__/next-auth.js',
'^next-auth/(.*)$': '<rootDir>/__mocks__/next-auth.js'
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
globalSetup: '<rootDir>/jest.globalSetup.js',
globalTeardown: '<rootDir>/jest.globalTeardown.js',
clearMocks: true,
resetMocks: true,
restoreMocks: true
};