-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
42 lines (40 loc) · 1 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
const packagesToTransform = [
"react-native",
"react-native-(.*)",
"@react-native",
"@react-native-community",
"@react-navigation",
"expo",
"expo-(.*)",
"react-native-svg",
"moti",
]
const config = {
preset: 'jest-expo',
// test environment setup
setupFiles: ['./jest.setup.js'],
setupFilesAfterEnv: ['./test/setup-env.ts'],
clearMocks: true,
// module resolution
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
transformIgnorePatterns: [
`node_modules/(?!(${packagesToTransform.join("|")})/)`
],
// module transformation
testRegex: "\\.spec\\.tsx?$",
transform: {
'^.+\\.svg$': 'jest-transformer-svg',
},
//coverage
coverageThreshold: {
global: {
branches: 70,
functions: 70,
lines: 80,
statements: 70,
},
},
collectCoverageFrom: ['src/components/**/*.{ts,tsx}', 'src/pages/**/*.{ts,tsx}', 'src/hooks/**/*.{ts,tsx}', 'src/context/**/*.{ts,tsx}'],
coveragePathIgnorePatterns: ['index.ts', 'mock.ts'],
}
module.exports = config