-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
35 lines (34 loc) · 956 Bytes
/
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
/** @type {import('jest').Config} */
export default {
// Workaround for https://github.com/jestjs/jest/issues/14305 which is fixed in jest 30.
prettierPath: new URL(await import.meta.resolve("prettier-2")).pathname,
testEnvironment: "<rootDir>/jest-environment-jsdom.ts",
testPathIgnorePatterns: [".(fixtures|mock|utils).tsx?$"],
transform: {
"^.+\\.(t|j)sx?$": [
"@swc/jest",
{
jsc: {
transform: {
react: {
runtime: "automatic",
},
optimizer: {
globals: {
vars: {
"import.meta.env": "__import_meta_env",
},
},
},
},
},
},
],
},
extensionsToTreatAsEsm: [".ts", ".tsx"],
setupFilesAfterEnv: ["<rootDir>/jest-setup.ts"],
// TODO: update any tests that rely on reset
clearMocks: true,
// resetMocks: true,
// resetModules: true,
};