-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
35 lines (31 loc) · 984 Bytes
/
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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const nextJest = require("next/jest");
const createJestConfig = nextJest({
dir: "./",
});
/** @type {import('jest').Config} */
const customJestConfig = {
setupFilesAfterEnv: ["jest-extended/all", "<rootDir>/jest.setup.ts"],
moduleDirectories: ["node_modules", "<rootDir>/"],
moduleNameMapper: {
"^@styles/(.*)$": "src/styles/$1",
"^@modeling/(.*)$": "src/modeling/$1",
"^@components/(.*)$": "src/components/$1",
"^@db/(.*)$": "db/$1",
"^@lib/(.*)$": "src/lib/$1",
"^@pages/(.*)$": "src/pages/$1",
"^@api/(.*)$": "src/pages/api/$1",
"^@hooks/(.*)$": "src/hooks/$1",
},
testEnvironment: "jest-environment-jsdom",
clearMocks: true,
preset: "ts-jest",
};
const asyncConfig = createJestConfig(customJestConfig);
module.exports = async () => {
const config = await asyncConfig();
config.transformIgnorePatterns = [
// ...your ignore patterns
];
return config;
};