-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
executable file
·54 lines (52 loc) · 1.42 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
48
49
50
51
52
53
54
// eslint-disable-next-line jest/no-jest-import
import type { Config } from 'jest'
const config: Config = {
testEnvironment: 'jest-environment-jsdom',
collectCoverage: true,
fakeTimers: {
enableGlobally: true
},
testPathIgnorePatterns: ['/node_modules'],
moduleDirectories: ['node_modules', '<rootDir>/'],
setupFilesAfterEnv: ['<rootDir>/.jest/setup.ts'],
modulePaths: ['<rootDir>/src/', '<rootDir>/.jest'],
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
coveragePathIgnorePatterns: [
'src/index.tsx',
'src/app.tsx',
'src/pages/index.tsx',
'src/routes/',
'src/components/index.tsx',
'src/components/templates/index.tsx',
'src/theme/',
'src/globalStyles/',
'src/providers/',
'src/assets/',
'src/tests/providers/',
'src/types/',
'src/testHelpers/',
'types.ts'
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'node'],
roots: ['<rootDir>/src'],
testRegex: '(/__tests__/.*|(\\.|/)(test))\\.tsx?$',
moduleNameMapper: {
'^.+\\.svg$': '<rootDir>/src/testHelpers/mocks/fileMock.ts'
},
transform: {
'^.+\\.tsx?$': [
'@swc/jest',
{ jsc: { transform: { react: { runtime: 'automatic' } } } }
],
'\\.(webp|svg)$': '<rootDir>/src/testHelpers/mocks/assetsTransformer.js'
}
// coverageThreshold: {
// global: {
// branches: 85,
// functions: 85,
// lines: 85,
// statements: -10
// }
// }
}
export default config