-
Notifications
You must be signed in to change notification settings - Fork 31
/
jest.config.ts
52 lines (50 loc) · 1.67 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
51
52
import type {Config} from '@jest/types';
import expoPreset from 'jest-expo/jest-preset';
process.env.TZ = 'Asia/Seoul';
export default async (): Promise<Config.InitialOptions> => {
return {
automock: false,
clearMocks: true,
preset: 'jest-expo',
transform: {
'^.+\\.(js|jsx|ts|tsx)$': 'babel-jest',
},
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.json'},
},
modulePathIgnorePatterns: [
'<rootDir>/lib/',
'<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/jestSetup.ts',
'./node_modules/react-native-gesture-handler/jestSetup.js',
],
cacheDirectory: '.jest/cache',
setupFilesAfterEnv: ['./test/setupTest.ts'],
haste: {
defaultPlatform: 'ios',
platforms: ['android', 'ios', 'native'],
},
transformIgnorePatterns: [
// eslint-disable-next-line max-len
'node_modules/(?!((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|dooboo-ui|@dooboo-ui)',
],
coveragePathIgnorePatterns: [
'.example.',
'__assets__',
'stories',
'/node_modules/',
],
};
};