-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathjest.config.js
53 lines (53 loc) · 2.13 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
// jest.config.js
const { defaults: tsjPreset } = require("ts-jest/presets");
module.exports = {
...tsjPreset,
verbose: true,
preset: "react-native",
globals: {
"ts-jest": {
tsconfig: "tsconfig.spec.json",
},
},
transform: {
"^.+\\.jsx$": "babel-jest",
"^.+\\.tsx?$": "ts-jest",
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js",
},
transformIgnorePatterns: [
"<rootDir>/node_modules/(react-clone-referenced-element|@react-native-community|@yz1311/react-native-wheel-picker|react-native-blob-util|react-native-pdf|@react-native-community/datetimepicker|react-navigation|react-native-device-info|@react-native-community/masked-view|react-native-skeleton-placeholder/lib/SkeletonPlaceholder.js|engine.io-client|engine.io-parser|socket.io-parser|@react-navigation/.*|@unimodules/.*)",
],
moduleNameMapper: {
"react-i18next": "<rootDir>/__mocks__/i18n.ts",
"@react-native-community/datetimepicker":
"<rootDir>/__mocks__/DateTimePicker.tsx",
"^@api(.*)$": "<rootDir>/src/api$1",
"^@assets(.*)$": "<rootDir>/src/assets$1",
"^@components(.*)$": "<rootDir>/src/components$1",
"^@lib(.*)$": "<rootDir>/src/lib$1",
"^@localization(.*)$": "<rootDir>/src/localization$1",
"^@navigation(.*)$": "<rootDir>/src/navigation$1",
"^@rtk(.*)$": "<rootDir>/src/rtk$1",
"^@screens(.*)$": "<rootDir>/src/screens$1",
"^@theme(.*)$": "<rootDir>/src/theme$1",
"^@utils$": "<rootDir>/src/utils/index",
},
setupFiles: [
"./jest.setup.js",
"<rootDir>/node_modules/react-native/jest/setup.js",
"<rootDir>/node_modules/react-native-gesture-handler/jestSetup.js",
],
setupFilesAfterEnv: ["@testing-library/jest-native/extend-expect"],
testMatch: [
"**/__tests__/**/*.ts?(x)",
"**/?(*.)+(test).ts?(x)",
"**/?(*.)+(test).js?(x)",
],
testEnvironment: "node",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
collectCoverage: false,
collectCoverageFrom: ["src/components/**/*.{ts,tsx}"],
coverageReporters: ["text", "cobertura", "lcov"],
reporters: ["default", "jest-junit"],
testResultsProcessor: "jest-sonar-reporter",
};