-
Notifications
You must be signed in to change notification settings - Fork 11
/
jest.config.mjs
41 lines (38 loc) · 1.13 KB
/
jest.config.mjs
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
import nextJest from "next/jest.js";
const createJestConfig = nextJest({
dir: "./",
});
// Add any custom config to be passed to Jest
/** @type {import('jest').Config} */
const config = {
testEnvironment: "jest-environment-jsdom",
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
"^test-utils": "<rootDir>/@types/test-utils/test-utils.tsx",
},
testPathIgnorePatterns: ["<rootDir>/e2e/"],
modulePathIgnorePatterns: ["<rootDir>/e2e/"],
passWithNoTests: true,
collectCoverageFrom: [
"**/*.{ts,tsx}",
"!**/*.d.ts",
"!**/node_modules/**",
"!**/coverage/**",
"!**/jest.config.js",
"!**/jest.setup.js",
"!**/types/**",
"!**/@types/**",
"!**/next-env.d.ts",
"!**/next.config.js",
"!**/jest.config.mjs",
"!<rootDir>/tailwind.config.ts",
"!**/postcss.config.js",
"!**/layout.{ts,tsx,js,jsx}",
"!<rootDir>/e2e/**",
"!<rootDir>/i18n.ts",
"!<rootDir>/middleware.ts",
],
};
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
export default createJestConfig(config);