-
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) · 836 Bytes
/
Copy pathjest.config.js
File metadata and controls
29 lines (26 loc) · 836 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: "./",
});
const customJestConfig = {
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
testEnvironment: "jest-environment-jsdom",
moduleNameMapper: {
"^swiper/css$": "<rootDir>/__mocks__/styleMock.js",
"^swiper/css/(.*)$": "<rootDir>/__mocks__/styleMock.js",
"^@/(.*)$": "<rootDir>/$1",
"^.+\\.(css|less|scss|sass)$": "<rootDir>/__mocks__/styleMock.js",
},
collectCoverageFrom: [
"components/**/*.{js,jsx,ts,tsx}",
"lib/**/*.{js,jsx,ts,tsx}",
"hooks/**/*.{js,jsx,ts,tsx}",
"config/**/*.{js,jsx,ts,tsx}",
"!**/*.d.ts",
"!**/node_modules/**",
],
coverageThreshold: {
global: { branches: 41, functions: 43, lines: 48, statements: 50 },
},
};
module.exports = createJestConfig(customJestConfig);