-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
49 lines (48 loc) · 1.22 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
40
41
42
43
44
45
46
47
48
49
const { pathsToModuleNameMapper } = require('ts-jest')
const { compilerOptions } = require('./tsconfig')
module.exports = {
preset: 'jest-expo',
setupFiles: ['./node_modules/react-native-gesture-handler/jestSetup.js'],
setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect', './src/utils/__mocks__/index.ts'],
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))(?<!\\.disabled)\\.[jt]sx?$',
transform: {
'\\.[jt]sx?$': 'babel-jest',
'\\.ts$': [
'ts-jest',
{
tsconfig: 'tsconfig.jest.json',
},
],
},
transformIgnorePatterns: [
`node_modules/
(?!((jest-)?
@expo(nent)?/.*|
@expo-google-fonts/.*|
@react-native(-community)?|
@react-native-firebase|
@react-navigation/.*|
@sentry/react-native|
expo(nent)?|
expo-modules-core|
expo-router|
imgix-core-js|
native-base|
react-native|
react-native-keyboard-area|
react-native-linear-gradient|
react-native-payments|
react-native-reanimated|
react-native-svg|
react-native-ui-lib|
react-navigation|
/*)/)`,
],
testEnvironment: 'node',
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>',
}),
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
}