-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
48 lines (48 loc) · 1.23 KB
/
jest.config.js
File metadata and controls
48 lines (48 loc) · 1.23 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
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
'^@/(.*)$': '<rootDir>/src/$1',
'^@types/(.*)$': '<rootDir>/src/types/$1',
'^@interfaces/(.*)$': '<rootDir>/src/interfaces/$1',
'^@services/(.*)$': '<rootDir>/src/services/$1',
'^@utils/(.*)$': '<rootDir>/src/utils/$1',
'^@config/(.*)$': '<rootDir>/src/config/$1',
'^@errors/(.*)$': '<rootDir>/src/errors/$1',
},
transformIgnorePatterns: [
'node_modules/(?!(chalk|ora|inquirer|execa|glob|find-up)/)',
],
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
},
],
},
testMatch: [
'<rootDir>/src/**/__tests__/**/*.test.ts',
'<rootDir>/src/**/*.spec.ts',
],
collectCoverageFrom: [
'src/**/*.ts',
'!src/**/*.d.ts',
'!src/**/__tests__/**',
'!src/**/index.ts',
'!src/bin/**',
],
coverageThreshold: {
global: {
statements: 65,
branches: 55,
functions: 65,
lines: 65,
},
},
coverageReporters: ['text', 'lcov', 'html'],
setupFilesAfterEnv: ['<rootDir>/src/__tests__/setup.ts'],
};