-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
63 lines (62 loc) · 1.46 KB
/
jest.config.js
File metadata and controls
63 lines (62 loc) · 1.46 KB
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
56
57
58
59
60
61
62
63
const esModules = [
"d3-array",
"d3-hierarchy",
"internmap",
"d3-scale",
"pretty-bytes",
"simplebar-react",
"simplebar",
"@react-dnd",
"react-dnd",
"dnd-core",
"react-dnd-html5-backend",
"react-merge-refs",
"uuid",
"@deskpro/deskpro-ui",
"node-fetch",
"data-uri-to-buffer",
"fetch-blob",
"formdata-polyfill",
].join("|");
module.exports = {
testEnvironment: "jsdom",
resolver: "<rootDir>/custom-jest-resolver",
maxWorkers: "75%",
modulePaths: ["<rootDir>/src/"],
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
transform: {
"^.+\\.(t|j)sx?$": [
"@swc/jest",
{
sourceMaps: true,
},
],
"^.+\\.mjs$": "@swc/jest",
},
moduleNameMapper: {
"\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/config/jest/fileTransform.js",
"\\.(css|less)$": "<rootDir>/config/jest/fileTransform.js",
},
transformIgnorePatterns: [`/node_modules/.pnpm/(?!${esModules})`],
modulePathIgnorePatterns: ["/node_modules/", ".dist"],
collectCoverageFrom: ["<rootDir>/src/**/*.{ts,tsx}"],
testMatch: ["**/?(*.)+(spec|test).[jt]s?(x)"],
coveragePathIgnorePatterns: [
"node_modules",
"codegen-agent",
"codegen-admin",
".gen.ts",
"testing",
"__tests__",
"__mocks__",
".test.ts",
".test.tsx",
".stories.tsx",
".dist",
".d.ts",
"mocks",
".app-story.tsx",
],
globalSetup: "./config/jest/global-setup.js",
};