forked from pass-culture/pass-culture-app-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
54 lines (54 loc) · 1.79 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
53
54
module.exports = {
preset: 'react-native',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'^api(.*)$': '<rootDir>/src/api$1',
'^features(.*)$': '<rootDir>/src/features$1',
'^fixtures(.*)$': '<rootDir>/src/fixtures$1',
'^libs(.*)$': '<rootDir>/src/libs$1',
'^theme(.*)$': '<rootDir>/src/theme$1',
'^locales(.*)$': '<rootDir>/src/locales$1',
'^types(.*)$': '<rootDir>/src/types$1',
'^tests(.*)$': '<rootDir>/src/tests$1',
'^ui(.*)$': '<rootDir>/src/ui$1',
'^__mocks__(.*)$': '<rootDir>/__mocks__$1',
},
snapshotResolver: '<rootDir>/jest/custom-snapshot-resolver-native.js',
setupFiles: ['<rootDir>/jest/jest.setup.ts', 'react-native-gesture-handler/jestSetup.js'],
setupFilesAfterEnv: ['./src/tests/setupTests.js'],
transform: {
'^.+\\.[jt]sx?$': 'babel-jest',
},
transformIgnorePatterns: [
'node_modules/(?!(jest-)?react-native' +
'|@react-navigation' +
'|@react-native' +
'|@ptomasroos/react-native-multi-slider' +
'|react-navigation' +
'|@react-native-firebase/analytics' +
'|@react-native-firebase/app' +
'|@react-native-firebase/remote-config' +
'|@sentry/react-native' +
'|react-native-geolocation-service' +
'|instantsearch.js' +
'/(?!(lib)))',
],
testRegex: '(?<!.web).(?:test|spec).(?:tsx?|js)$',
testPathIgnorePatterns: [
'\\.snap$',
'\\.native-snap$',
'\\.web-snap$',
'<rootDir>/node_modules/',
'<rootDir>/server/'
],
cacheDirectory: '.jest/cache',
clearMocks: true,
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}', '!**/node_modules/**', '!**/coverage/**'],
coveragePathIgnorePatterns: [
'\\.web\\.(test|spec)',
'/node_modules/',
'/src/environment',
'/src/locales',
],
collectCoverage: false,
}