-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
50 lines (48 loc) · 1.64 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
45
46
47
48
49
50
import type {Config} from '@jest/types';
//@ts-ignore
import expoPreset from 'jest-expo/jest-preset';
process.env.TZ = 'Asia/Seoul';
export default async (): Promise<Config.InitialOptions> => {
return {
automock: false,
preset: 'jest-expo',
transform: {
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest',
},
transformIgnorePatterns: [
// eslint-disable-next-line max-len
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|expo-router|@expo-router/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|dooboo-ui|@dooboo-ui)',
],
modulePaths: ['<rootDir>'],
moduleDirectories: ['node_modules'],
testMatch: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
moduleFileExtensions: ['js', 'ts', 'tsx', 'svg', 'png', 'json'],
globals: {
'ts-jest': {tsconfig: 'tsconfig.spec.json'},
},
modulePathIgnorePatterns: [
'<rootDir>/build/',
'<rootDir>/node_modules/',
'<rootDir>/.history/',
],
moduleNameMapper: {
'\\.svg': '<rootDir>/__mocks__/svgMock.js',
'.+\\.(css|style|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'babel-jest',
},
setupFiles: [
...expoPreset.setupFiles,
'<rootDir>/test/utils/jestSetup.ts',
'./node_modules/react-native-gesture-handler/jestSetup.js',
],
cacheDirectory: '.jest/cache',
setupFilesAfterEnv: [
'@testing-library/jest-native/extend-expect',
'./test/utils/setupTest.ts',
],
haste: {
defaultPlatform: 'ios',
platforms: ['android', 'ios', 'native'],
},
coveragePathIgnorePatterns: ['/node_modules/'],
};
};