-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
55 lines (54 loc) · 1.56 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
55
const { defaults: tsjPreset } = require('ts-jest/presets');
module.exports = {
coverageThreshold: {
global: {
branches: 70,
functions: 60,
lines: 75,
statements: 70,
},
},
preset: 'react-native',
moduleDirectories: ['node_modules', 'src'],
globals: {
'ts-jest': {
tsConfig: 'tsconfig.test.json',
importHelpers: true,
},
},
transform: {
...tsjPreset.preset,
},
transformIgnorePatterns: [
'node_modules/(?!react-native-haptic|rn-placeholder)/',
'node_modules/jest-runner/',
'.stories.tsx',
],
modulePathIgnorePatterns: ['<rootDir>/dist/'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
setupFilesAfterEnv: [
'@testing-library/jest-native/extend-expect',
'<rootDir>/src/__mocks__/react-native-haptic-feedback.ts',
'<rootDir>/src/__mocks__/platformbuilders-helpers.ts',
],
cacheDirectory: '.jest/cache',
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!**/node_modules/**',
'!**/assets/**',
'!**/types/**',
'!**/__tests__/**',
'!**/documentation/**',
'!**/storybook/**',
'!**/*.stories.tsx',
'!**/styles.ts',
'!**/*.enum.ts',
'!src/enums/index.ts', // No need to test exported files
'!src/utils/helpers/index.ts', // No need to test exported files
'!src/theme/animations.ts', // No need to test exported files
'!src/index.ts', // No need to test exported files
'!src/components/index.ts', // No need to test exported files
'!**/*.d.ts', // No need to test types declarations
],
};