-
Notifications
You must be signed in to change notification settings - Fork 3
/
jest.config.js
49 lines (49 loc) · 1.64 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
module.exports = {
collectCoverageFrom: [
"**/*.{js,jsx,ts,tsx}",
"!**/*.d.ts",
"!**/*.skeleton.tsx",
"!**/node_modules/**",
"!**/.next/**",
"!**/coverage/**",
"!**/jest.config.js/**",
"!**/next.config.js/**",
"!**/postcss.config.js/**",
"!**/tailwind.config.js/**",
"!**/types*/**",
"!**/middleware.ts**",
"!**/mocks*/**",
],
coveragePathIgnorePatterns: [
"/pages/api/auth/\\[\\.\\.\\.nextauth\\].ts",
"/lib/connectMongoDb.ts",
"/lib/mongoDb.ts",
],
moduleNameMapper: {
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy",
"^.+\\.(css|sass|scss)$": "<rootDir>/__mocks__/styleMock.js",
"^.+\\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$": `<rootDir>/__mocks__/fileMock.js`,
"^@/components/(.*)$": "<rootDir>/components/$1",
"^@/pages/(.*)$": "<rootDir>/pages/$1",
"^@/modules/(.*)$": "<rootDir>/modules/$1",
"^@/services/(.*)$": "<rootDir>/services/$1",
"^@/utils/(.*)$": "<rootDir>/utils/$1",
"^@/types/(.*)$": "<rootDir>/types/$1",
"^@/mocks/(.*)$": "<rootDir>/mocks/$1",
"^@/hooks/(.*)$": "<rootDir>/hooks/$1",
"^@/lib/(.*)$": "<rootDir>/lib/$1",
"^@/model/(.*)$": "<rootDir>/model/$1",
"^bcrypt$": "<rootDir>/__mocks__/bcrypt.js",
},
setupFiles: ["<rootDir>/test.env.ts"],
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
testPathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/.next/"],
transform: {
"^.+\\.(js|jsx|ts|tsx)$": ["babel-jest", { presets: ["next/babel"] }],
},
transformIgnorePatterns: [
"/node_modules/",
"^.+\\.module\\.(css|sass|scss)$",
],
testEnvironment: "jest-environment-jsdom",
};