-
Notifications
You must be signed in to change notification settings - Fork 273
Expand file tree
/
Copy pathjest.config.js
More file actions
52 lines (52 loc) · 1.92 KB
/
Copy pathjest.config.js
File metadata and controls
52 lines (52 loc) · 1.92 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
module.exports = {
preset: 'jest-expo',
roots: ['<rootDir>/src', '<rootDir>/tests'],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(ts|tsx)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
moduleNameMapper: {
// Root-level components/hooks/constants imported via @/ alias.
// The @/ alias maps to src/, but some legacy modules live at the root.
'^@/components/(themed-text|themed-view)$': '<rootDir>/components/$1',
'^@/src/hooks$': '<rootDir>/src/hooks/index',
'^@/hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^@/constants/(.*)$': '<rootDir>/constants/$1',
'^@/(.*)$': '<rootDir>/src/$1',
'^@components/(.*)$': '<rootDir>/src/components/$1',
'^@hooks/(.*)$': '<rootDir>/src/hooks/$1',
'^@services/(.*)$': '<rootDir>/src/services/$1',
'^@store/(.*)$': '<rootDir>/src/store/$1',
'^@types/(.*)$': '<rootDir>/src/types/$1',
'^@utils/(.*)$': '<rootDir>/src/utils/$1',
},
transformIgnorePatterns: [
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)',
],
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/*.d.ts', '!src/**/index.ts'],
testPathIgnorePatterns: ['/node_modules/'],
// Leak detection: report open handles so tests don't mask async bugs.
detectOpenHandles: true,
// Exit cleanly after the suite instead of waiting for stale timers.
forceExit: true,
collectCoverage: true,
coverageThreshold: {
global: {
branches: 75,
functions: 75,
lines: 75,
statements: 75,
},
'./src/services/': {
branches: 90,
functions: 90,
lines: 90,
statements: 90,
},
'./src/store/': {
branches: 90,
functions: 90,
lines: 90,
statements: 90,
},
},
};