-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathjest.config.js
More file actions
79 lines (79 loc) · 3.11 KB
/
Copy pathjest.config.js
File metadata and controls
79 lines (79 loc) · 3.11 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
module.exports = {
preset: '@react-native/jest-preset',
transformIgnorePatterns: [
// Transform all RN, Expo and related packages whether installed directly or
// via pnpm's virtual store (.pnpm/<pkg>@<ver>/node_modules/<pkg>).
'node_modules/(?!(' +
// pnpm virtual-store paths for packages we must transform
'\\.pnpm/(jest-)?react-native[^/]|' +
'\\.pnpm/@react-native[^/]|' +
'\\.pnpm/expo[^/]|' +
'\\.pnpm/@expo[^/]|' +
'\\.pnpm/@unimodules[^/]|' +
'\\.pnpm/react-navigation[^/]|' +
'\\.pnpm/@react-navigation[^/]|' +
'\\.pnpm/@sentry[^/]|' +
'\\.pnpm/native-base[^/]|' +
'\\.pnpm/react-native-svg[^/]|' +
'\\.pnpm/@walletconnect[^/]|' +
// Standard (non-pnpm) paths
'(jest-)?react-native|@react-native(-community)?|' +
'expo(nent)?|@expo(nent)?/|@expo-google-fonts/|' +
'@unimodules/|react-navigation|@react-navigation/|' +
'@sentry/react-native|native-base|react-native-svg|@walletconnect/' +
'))',
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts',
'!src/**/index.ts',
'!src/**/*.stories.tsx',
'!src/**/*.test.tsx',
'!src/**/*.test.ts'
],
coverageThresholds: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80
}
},
testMatch: ['**/__tests__/**/*.(test|spec).[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
modulePathIgnorePatterns: ['<rootDir>/e2e'],
testPathIgnorePatterns: [
'/node_modules/',
'<rootDir>/e2e/',
'<rootDir>/src/animations/',
'<rootDir>/backend/',
'<rootDir>/developer-portal/',
'<rootDir>/contracts/',
'<rootDir>/chaos/',
'<rootDir>/babel.config.test.js',
],
moduleNameMapper: {
'^bullmq$': '<rootDir>/backend/shared/queue/__mocks__/bullmq.ts',
'^@/(.*)$': '<rootDir>/src/$1',
'^@testing-library/react-native$': '<rootDir>/src/__mocks__/@testing-library/react-native.js',
'^@react-native-community/netinfo$':
'<rootDir>/src/__mocks__/@react-native-community/netinfo.js',
'^@react-native-async-storage/async-storage$':
'<rootDir>/src/__mocks__/@react-native-async-storage/async-storage.js',
'^expo-haptics$': '<rootDir>/src/__mocks__/expo-haptics.js',
'^expo-notifications$': '<rootDir>/src/__mocks__/expo-notifications.js',
'^expo-linear-gradient$': '<rootDir>/src/__mocks__/expo-linear-gradient.js',
'^expo-application$': '<rootDir>/src/__mocks__/expo-application.js',
'^expo-clipboard$': '<rootDir>/src/__mocks__/expo-clipboard.js',
'^expo-image$': '<rootDir>/src/__mocks__/expo-image.js',
'^expo-linking$': '<rootDir>/src/__mocks__/expo-linking.js',
'^@expo/vector-icons$': '<rootDir>/src/__mocks__/@expo/vector-icons.js',
'^@expo/vector-icons/(.*)$': '<rootDir>/src/__mocks__/@expo/vector-icons.js',
ViewConfigIgnore$: '<rootDir>/src/__mocks__/ViewConfigIgnore.js',
},
transform: {
'^.+\\.(js|ts|tsx)$': ['babel-jest', { configFile: './babel.config.test.js' }],
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testEnvironment: 'node',
};