-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
35 lines (34 loc) · 1.09 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
// By default, all files inside `node_modules` are not transformed. But some 3rd party
// modules are published as un-transpiled, Jest will not understand the code in these modules.
// To overcome this, exclude these modules in the ignore pattern.
const untranspiledModulePatterns = [
'((jest-)?react-native',
'@react-native(-community)?)',
'expo(nent)?',
'@expo(nent)?/.*',
'@expo-google-fonts/.*',
'react-navigation',
'@react-navigation/.*',
'@unimodules/.*',
'unimodules',
'sentry-expo',
'native-base',
'react-native-svg',
'@rneui',
];
module.exports = {
preset: 'jest-expo',
setupFiles: [
'<rootDir>/jest/setup.js',
'<rootDir>/node_modules/react-native-gesture-handler/jestSetup.js',
],
transformIgnorePatterns: [
`node_modules/(?!${untranspiledModulePatterns.join('|')})`,
],
setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
moduleNameMapper: {
'\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/jest/mocks/file.ts',
},
};