forked from Streampay-Org/StreamPay-Frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
29 lines (26 loc) · 845 Bytes
/
Copy pathjest.config.js
File metadata and controls
29 lines (26 loc) · 845 Bytes
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
const nextJest = require("next/jest");
const createJestConfig = nextJest({ dir: "./" });
/** @type {import('jest').Config} */
const config = {
testEnvironment: "node",
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
testMatch: ["**/*.test.{ts,tsx}", "**/*.spec.{ts,tsx}"],
collectCoverageFrom: [
"app/**/*.{ts,tsx}",
"lib/**/*.{ts,tsx}",
"!**/*.d.ts",
"!**/*.test.{ts,tsx}",
],
};
module.exports = async () => {
const makeConfig = createJestConfig(config);
const resolvedConfig = await makeConfig();
resolvedConfig.moduleNameMapper = {
...resolvedConfig.moduleNameMapper,
"^@/(.*)$": "<rootDir>/$1",
"^\\./app/(.*)$": "<rootDir>/app/$1",
"^next/navigation$": "<rootDir>/__mocks__/next/navigation.js",
"^next/router$": "<rootDir>/__mocks__/next/router.js",
};
return resolvedConfig;
};