-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
56 lines (55 loc) · 1.92 KB
/
jest.config.js
File metadata and controls
56 lines (55 loc) · 1.92 KB
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
/** @type {import('jest').Config} */
const ignoredProjectPaths = ["<rootDir>/.worktrees/"];
module.exports = {
projects: [
// Unit tests - pure Node.js environment
{
displayName: "unit",
testEnvironment: "node",
testMatch: ["<rootDir>/tests/unit/**/*.test.ts"],
modulePathIgnorePatterns: ignoredProjectPaths,
testPathIgnorePatterns: ignoredProjectPaths,
transform: {
"^.+\\.tsx?$": ["ts-jest", { tsconfig: "tsconfig.json" }],
},
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
},
},
// Integration tests - Node.js environment with container
{
displayName: "integration",
testEnvironment: "node",
testMatch: ["<rootDir>/tests/integration/**/*.test.ts"],
modulePathIgnorePatterns: ignoredProjectPaths,
testPathIgnorePatterns: ignoredProjectPaths,
transform: {
"^.+\\.tsx?$": ["ts-jest", { tsconfig: "tsconfig.json" }],
},
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
},
// Integration tests need longer timeout for container startup
globals: {
"ts-jest": {
// Integration test timeout handled via jest.setTimeout in test file
},
},
},
// Component tests - React Native environment
{
displayName: "components",
preset: "jest-expo",
testMatch: ["<rootDir>/tests/components/**/*.test.tsx"],
modulePathIgnorePatterns: ignoredProjectPaths,
testPathIgnorePatterns: ignoredProjectPaths,
setupFilesAfterEnv: ["<rootDir>/tests/setup.ts"],
transformIgnorePatterns: [
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg|react-native-paper)",
],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
},
},
],
};