-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
64 lines (61 loc) · 1.43 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
53
54
55
56
57
58
59
60
61
62
63
64
import { Config } from "@jest/types";
// By default, all files inside `node_modules` are not transformed. But some 3rd party
// modules are published as untranspiled, Jest will not understand the code in these modules.
// To overcome this, exclude these modules in the ignore pattern.
const untranspiledModulePatterns = [
"(jest-)?react-native",
"@react-native-community",
"expo(nent)?",
"@expo(nent)?/.*",
"@react-native",
"react-navigation",
"@react-navigation/.*",
"@unimodules/.*",
"unimodules",
"sentry-expo",
"native-base",
"react-native-svg",
];
// jest.config.js
// Sync object
const config: Config.InitialOptions = {
testEnvironment: "node",
preset: "jest-expo",
globals: {
"ts-jest": {
tsconfig: 'tsconfig.spec.json',
}
},
testMatch: [
"**/?(*.)+(spec|test).ts?(x)"
],
collectCoverageFrom: [
"**/*.{ts,tsx}",
"!**/coverage/**",
"!**/node_modules/**",
"!**/babel.config.js",
"!**/jest.setup.js"
],
moduleFileExtensions: [
"ts",
"tsx",
"js",
"jsx",
'json',
'node'
],
transformIgnorePatterns: [
`node_modules/(?!${untranspiledModulePatterns.join("|")})`,
],
coverageReporters: [
"json-summary",
"text",
"lcov"
],
setupFiles: [
"<rootDir>/jest/setup.js",
'./node_modules/react-native-gesture-handler/jestSetup.js'
],
setupFilesAfterEnv: ["@testing-library/jest-native/extend-expect"],
};
export default config;