-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathjest.config.ts
47 lines (45 loc) · 1.04 KB
/
jest.config.ts
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
import type { Config } from 'jest'
const config: Config = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
moduleDirectories: ['node_modules', '<rootDir>'],
roots: ['<rootDir>/src'],
modulePaths: ['<rootDir>/src'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
"\\.(css|scss|svg|png|jpg)$": "identity-obj-proxy",
},
transform: {
'^.+\\.tsx?$': ['ts-jest', {
tsconfig: './tsconfig.jest.json'
}],
"^.+\\.js$": "babel-jest",
},
testPathIgnorePatterns: [
'/node_modules/',
'/dist/'
],
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/types.ts',
'!src/constants/**',
'!src/**/index.ts',
'!**/node_modules/**'
],
coverageThreshold: {
global: {
branches: 70,
functions: 70,
lines: 70,
statements: 70,
},
},
testMatch: [
'<rootDir>/src/**/__tests__/**/*.{ts,tsx}',
'<rootDir>/src/**/*.{spec,test}.{ts,tsx}'
]
}
export default config