-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
52 lines (51 loc) · 1.63 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* eslint-disable @typescript-eslint/no-var-requires */
const expoPreset = require('jest-expo/jest-preset');
const jestPreset = require('@testing-library/react-native/jest-preset');
/* eslint-enable @typescript-eslint/no-var-requires */
module.exports = {
preset: '@testing-library/react-native',
automock: false,
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.tsx?$': 'ts-jest',
},
modulePaths: ['<rootDir>'],
moduleDirectories: ['node_modules'],
testMatch: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
moduleFileExtensions: ['js', 'ts', 'tsx', 'svg', 'png'],
globals: {
'ts-jest': {
babelConfig: true,
tsConfig: {
jsx: 'react',
},
diagnostics: false,
},
},
modulePathIgnorePatterns: [
'<rootDir>/build/',
'<rootDir>/node_modules/',
'<rootDir>/.history/',
],
moduleNameMapper: {
'\\.svg': '<rootDir>/__mocks__/svgMock.js',
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'babel-jest',
},
setupFiles: [
...expoPreset.setupFiles,
...jestPreset.setupFiles,
'<rootDir>/test/jestSetup.ts',
],
/* eslint-disable */
transformIgnorePatterns: [
'node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules-*|sentry-expo|native-base|@dooboo-ui)',
],
cacheDirectory: '.jest/cache',
/* eslint-enable */
setupFilesAfterEnv: ['./test/setupTest.ts'],
haste: {
defaultPlatform: 'ios',
platforms: ['android', 'ios', 'native'],
providesModuleNodeModules: ['react', 'react-native'],
},
};