-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathjest.config.cjs
More file actions
50 lines (50 loc) · 1.19 KB
/
jest.config.cjs
File metadata and controls
50 lines (50 loc) · 1.19 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
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
resolver: '<rootDir>/jest.resolver.cjs',
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: {
module: 'esnext',
target: 'es2022',
moduleResolution: 'node'
},
useESM: true,
},
],
},
setupFilesAfterEnv: ['<rootDir>/src/__tests__/setup.ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testMatch: [
'**/__tests__/**/*.test.ts',
'**/__tests__/**/*.spec.ts',
'**/__tests__/**/*.e2e.ts',
'**/tests/**/*.test.ts',
'**/tests/**/*.spec.ts',
],
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/**/*.test.ts',
'!src/**/*.spec.ts',
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'lcov', 'clover'],
verbose: true,
testTimeout: 10000,
maxWorkers: '50%',
moduleDirectories: ['node_modules', 'src'],
injectGlobals: true,
testEnvironmentOptions: {
url: 'http://localhost',
},
clearMocks: true,
resetMocks: false,
restoreMocks: false,
};