Skip to content

Commit c2a4313

Browse files
committed
add moduleNameMapper to jest cofigs
1 parent 495366d commit c2a4313

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

packages/react-router-dom-v5-compat/jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ module.exports = {
66
globals: {
77
__DEV__: true,
88
},
9+
moduleNameMapper: {
10+
"^@remix-run/router$": "<rootDir>/../router/index.ts",
11+
"^react-router$": "<rootDir>/../react-router/index.ts",
12+
"^react-router-dom-v5-compat$": "<rootDir>/index.ts",
13+
},
914
};

packages/react-router-dom/jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ module.exports = {
77
__DEV__: true,
88
},
99
setupFiles: ["./__tests__/setup.ts"],
10+
moduleNameMapper: {
11+
"^@remix-run/router$": "<rootDir>/../router/index.ts",
12+
"^react-router$": "<rootDir>/../react-router/index.ts",
13+
"^react-router-dom$": "<rootDir>/index.tsx",
14+
},
1015
};

packages/react-router-native/jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@ module.exports = {
1111
"<rootDir>/node_modules", // for react-native
1212
],
1313
setupFiles: ["<rootDir>/__tests__/setup.ts"],
14+
moduleNameMapper: {
15+
"^@remix-run/router$": "<rootDir>/../router/index.ts",
16+
"^react-router$": "<rootDir>/../react-router/index.ts",
17+
"^react-router-native$": "<rootDir>/index.tsx",
18+
},
1419
};

packages/react-router/jest.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@ module.exports = {
77
__DEV__: true,
88
},
99
setupFiles: ["./__tests__/setup.ts"],
10+
moduleNameMapper: {
11+
"^@remix-run/router$": "<rootDir>/../router/index.ts",
12+
"^react-router$": "<rootDir>/index.ts",
13+
},
1014
};

packages/router/jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ module.exports = {
77
__DEV__: true,
88
},
99
setupFiles: ["./__tests__/setup.ts"],
10+
moduleNameMapper: {
11+
"^@remix-run/router$": "<rootDir>/index.ts",
12+
},
1013
};

0 commit comments

Comments
 (0)