Repository navigation
Expand file tree
/
Copy pathjest.config.js
More file actions
44 lines (42 loc) · 1.69 KB
/
Copy pathjest.config.js
File metadata and controls
44 lines (42 loc) · 1.69 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
const { transform } = require('@react-native/jest-preset');
const transformIgnorePatterns = [
'node_modules/(?!\\.pnpm|(@react-navigation|react-native-drawer-layout|react-native-tab-view|(jest-)?@react-native|react-native|react-native-reanimated|react-native-worklets|react-native-gesture-handler|react-native-safe-area-context|nanoid|escape-string-regexp|immer|standard-navigation)/)',
'node_modules/.pnpm/(?!(?:@react-navigation\\+[^@]+|react-native-drawer-layout|react-native-tab-view|@react-native\\+[^@]+|react-native|react-native-reanimated|react-native-worklets|react-native-gesture-handler|react-native-safe-area-context|nanoid|escape-string-regexp|immer|standard-navigation)@)',
];
module.exports = {
projects: [
{
preset: '@react-native/jest-preset',
setupFilesAfterEnv: ['<rootDir>/jest/setup.js'],
testEnvironment: 'node',
testEnvironmentOptions: {
customExportConditions: ['react-native', '@react-navigation/source'],
},
testMatch: ['<rootDir>/**/__tests__/**/*.test.tsx'],
testPathIgnorePatterns: ['\\.web\\.test\\.tsx$'],
transformIgnorePatterns,
},
{
haste: {
defaultPlatform: 'web',
},
setupFilesAfterEnv: [
'<rootDir>/jest/setup.js',
'<rootDir>/jest/setup.web.js',
],
globals: {
IS_REACT_ACT_ENVIRONMENT: true,
},
moduleNameMapper: {
'^react-native$': 'react-native-web',
},
testEnvironment: 'node',
testEnvironmentOptions: {
customExportConditions: ['browser', '@react-navigation/source'],
},
testMatch: ['<rootDir>/**/__tests__/**/*.web.test.tsx'],
transform,
transformIgnorePatterns,
},
],
};