-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.unit.js
executable file
·52 lines (50 loc) · 1.4 KB
/
jest.config.unit.js
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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { defaults: tsjPreset } = require('ts-jest/presets')
const modulesNeedingTransform = [
'react-native-screens',
'@react-navigation/stack',
'@react-navigation/native',
'react-native',
'react-redux',
]
const modulesToIgnore = ['<rootDir>/ios', '<rootDir>/android']
module.exports = {
...tsjPreset,
collectCoverage: false,
coveragePathIgnorePatterns: ['/node_modules/', '.*.test..*'],
coverageReporters: ['text'],
coverageThreshold: {
global: {
branches: 100,
},
},
forceExit: true,
globals: {
'ts-jest': {
babelConfig: true,
},
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node', 'csv'],
modulePathIgnorePatterns: modulesToIgnore,
modulePaths: ['<rootDir>'],
preset: 'react-native',
resetMocks: false,
resetModules: false,
setupFilesAfterEnv: [
'<rootDir>/__tests__/index.ts',
'./node_modules/react-native-gesture-handler/jestSetup.js',
],
testMatch: [
'<rootDir>/__tests__/**/*.test.ts?(x)',
'<rootDir>/src/**/?(*.)test.ts?(x)',
],
testPathIgnorePatterns: ['<rootDir>/node_modules', ...modulesToIgnore],
transform: {
...tsjPreset.transform,
'\\.js$': '<rootDir>/node_modules/react-native/jest/preprocessor.js',
},
transformIgnorePatterns: [
`<rootDir>/node_modules/(?!${modulesNeedingTransform.join('|')})`,
],
verbose: true,
}