-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
jest.config.js
39 lines (38 loc) · 1.06 KB
/
jest.config.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
const { defaults: tsjPreset } = require('ts-jest/presets')
module.exports = {
...tsjPreset,
verbose: true,
preset: 'react-native',
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transform: {
...tsjPreset.transform,
'^.+\\.(js)$': '<rootDir>/node_modules/babel-jest',
'^.+\\.(ts|tsx)$': 'ts-jest',
},
testPathIgnorePatterns: ['\\.snap$', '<rootDir>/node_modules/'],
globals: {
'ts-jest': {
babelConfig: true,
diagnostics: {
ignoreCodes: [2307, 7016],
},
tsconfig: './tsconfig.jest.json',
},
},
modulePaths: ['<rootDir>'],
cacheDirectory: '.jest/cache',
transformIgnorePatterns: [
`node_modules/(?!(jest-)?${[
'react-native.*',
'@react-native-community',
'react-navigation-animated-switch',
'@react-navigation.*',
].join('|')})/`,
],
setupFiles: [
'<rootDir>/node_modules/react-native/jest/setup',
'<rootDir>/node_modules/react-native-gesture-handler/jestSetup',
],
setupFilesAfterEnv: ['<rootDir>/jest/setup.js'],
}