forked from LedgerHQ/ledger-live
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjest.config.js
77 lines (75 loc) · 2.25 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const { pathsToModuleNameMapper } = require("ts-jest");
const { compilerOptions } = require("./tsconfig");
const transformIncludePatterns = [
"@react-native/polyfills",
"(jest-)?react-native",
"@react-native(-community)?",
"@react-navigation",
"rn-range-slider",
"react-native-reanimated",
"react-native-modal",
"react-native-animatable",
"@sentry/react-native",
"@hashgraph/sdk",
"react-native-startup-time",
"@segment/analytics-react-native",
"uuid",
"react-native-ble-plx",
"react-native-android-location-services-dialog-box",
"react-native-vector-icons",
"react-native-qrcode-svg",
"react-native-video",
];
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
verbose: true,
preset: "react-native",
modulePaths: [compilerOptions.baseUrl],
setupFilesAfterEnv: [
"./node_modules/react-native-gesture-handler/jestSetup.js",
"./__tests__/jest-setup.js",
],
testMatch: ["**/src/**/*.test.(ts|tsx)"],
transform: {
"^.+\\.(t)sx?$": [
"@swc/jest",
{
jsc: {
target: "esnext",
},
},
],
},
transformIgnorePatterns: [
`node_modules/(?!(.pnpm|${transformIncludePatterns.join("|")})/)`,
"\\.pnp\\.[^\\/]+$",
],
testPathIgnorePatterns: ["<rootDir>/node_modules/"],
moduleDirectories: ["node_modules"],
collectCoverageFrom: [
"src/**/*.{ts,tsx}",
"!src/**/*.test.{ts,tsx}",
"!src/**/*.spec.{ts,tsx}",
"!src/**/__integration__/**",
"!src/**/__tests__/**",
],
coverageReporters: ["json", ["lcov", { projectRoot: "../" }], "json-summary"],
reporters: [
"default",
[
"jest-sonar",
{ outputName: "llm-sonar-executionTests-report.xml", reportedFilePath: "absolute" },
],
],
resolver: "<rootDir>/scripts/resolver.js",
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths),
"^react$": "<rootDir>/node_modules/react",
"^react/(.*)$": "<rootDir>/node_modules/react/$1",
"^react-native/(.*)$": "<rootDir>/node_modules/react-native/$1",
"^react-native$": "<rootDir>/node_modules/react-native",
"styled-components":
"<rootDir>/node_modules/styled-components/native/dist/styled-components.native.cjs.js",
"^react-redux": "<rootDir>/node_modules/react-redux",
},
};