-
Notifications
You must be signed in to change notification settings - Fork 13
/
jest.config.ts
35 lines (33 loc) · 1.05 KB
/
jest.config.ts
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
import type { Config } from '@jest/types';
// By default, all files inside `node_modules` are not transformed. But some 3rd party
// modules are published as untranspiled, Jest will not understand the code in these modules.
// To overcome this, exclude these modules in the ignore pattern.
const untranspiledModulePatterns = [
'@react-native',
'(jest-)?react-native',
'@react-native-community',
'expo(nent)?',
'@expo(nent)?/.*',
'react-navigation',
'@react-navigation/.*',
'@unimodules/.*',
'unimodules',
'native-base',
'react-native-svg',
'rn-fetch-blob',
'@internxt/rn-crypto',
'@rudderstack',
'realm',
];
const config: Config.InitialOptions = {
preset: 'jest-expo',
verbose: true,
testRegex: ['\\.spec\\.ts$', '\\.spec\\.tsx$'],
setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'],
transformIgnorePatterns: [`node_modules/(?!${untranspiledModulePatterns.join('|')})`],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
moduleNameMapper: {
'^uuid$': require.resolve('uuid'),
},
};
export default config;