-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.ts
44 lines (40 loc) · 1.14 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
36
37
38
39
40
41
42
43
44
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 = [
'((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',
];
const config: Config.InitialOptions = {
coverageReporters: ['json', 'json-summary', 'lcov'],
projects: [
{
preset: 'jest-expo/android',
setupFiles: ['<rootDir>/jest.setup.ts'],
},
{
preset: 'jest-expo/ios',
setupFiles: ['<rootDir>/jest.setup.ts'],
},
],
testMatch: [
'**/__tests__/**/*[.-]test.[jt]s?(x)',
'**/?(*.)+(spec|test).[jt]s?(x)',
],
transformIgnorePatterns: [
`node_modules/(?!${untranspiledModulePatterns.join('|')})`,
],
moduleFileExtensions: ['ts', 'tsx', 'js'],
};
export default config;