-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathjest.config.ts
55 lines (37 loc) · 1.06 KB
/
jest.config.ts
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
50
51
52
53
54
55
const nextJest = require("next/jest");
const createJestConfig = nextJest({ dir: "./" });
/**
* @type {import("@jest/types").Config.InitialOptions}
*/
const customJestConfig = {
clearMocks: true,
coverageProvider: "v8",
collectCoverageFrom: ["src/**/*.{ts,tsx}", "!**/Stories.tsx", "!**/*.d.ts"],
collectCoverage: false,
coverageThreshold: {
global: {
branches: 85,
functions: 85,
lines: 85,
statements: 85,
},
},
moduleDirectories: ["node_modules", "src"],
modulePaths: ["<rootDir>/src"],
roots: ["src"],
moduleNameMapper: {
nanoid: "<rootDir>/src/__tests__/__mocks__/nanoid.ts",
},
setupFiles: [
"<rootDir>/src/__tests__/_/setupGlobals.ts",
"<rootDir>/src/__tests__/_/consoleOverrides.ts",
],
setupFilesAfterEnv: ["<rootDir>/src/__tests__/_/setupAfterEnv.ts"],
testEnvironment: "jsdom",
testMatch: ["**/?(*.)+(spec).ts?(x)"],
transform: {},
transformIgnorePatterns: [],
testTimeout: 20000,
};
export default async (...args: any[]) =>
createJestConfig(customJestConfig)(...args);