-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.js
43 lines (42 loc) · 1.02 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
/** esm modules to transform */
const esmModules = [
// `query-string` and its related dependencies
"query-string",
"decode-uri-component",
"split-on-first",
"filter-obj",
];
module.exports = {
preset: "ts-jest/presets/js-with-ts",
testEnvironment: "jsdom",
clearMocks: true,
testPathIgnorePatterns: ["/.history/"],
modulePathIgnorePatterns: ["<rootDir>/package.json"],
resetMocks: false,
setupFiles: [
"./jest.setup.js",
"jest-localstorage-mock",
"./match-media-mock.js",
],
setupFilesAfterEnv: [
"@testing-library/jest-dom/extend-expect",
"@testing-library/jest-dom",
],
transform: {
"^.+\\.tsx?$": ["ts-jest", {tsconfig: "tsconfig.json"}],
},
collectCoverageFrom: [
"<rootDir>/**/src/**/*.{js,jsx,ts,tsx}",
"!**/demo/**",
"!**/example/**",
"!**/es/**",
"!**/lib/**",
"!**/dist/**",
],
moduleNameMapper: {
"\\.(css|less|scss)$": "identity-obj-proxy",
},
transformIgnorePatterns: [
`node_modules/(?!(?:.pnpm/)?(${esmModules.join("|")}))`,
],
};