|
1 | 1 | module.exports = { |
2 | | - // Use a big timeout for CI. |
3 | | - testTimeout: 20_000, |
4 | | - maxWorkers: 8, |
5 | | - projects: [ |
6 | | - { |
7 | | - displayName: "test", |
8 | | - roots: ["<rootDir>"], |
9 | | - setupFiles: ["./jest.polyfills.js"], |
10 | | - setupFilesAfterEnv: ["./jest.setup.ts"], |
11 | | - extensionsToTreatAsEsm: [".ts"], |
12 | | - transform: { |
13 | | - "^.+\\.(t|j)sx?$": [ |
14 | | - "@swc/jest", |
15 | | - { |
16 | | - jsc: { |
17 | | - transform: { |
18 | | - react: { |
19 | | - runtime: "automatic", |
20 | | - importSource: "@emotion/react", |
21 | | - }, |
22 | | - }, |
23 | | - experimental: { |
24 | | - plugins: [["jest_workaround", {}]], |
25 | | - }, |
26 | | - }, |
27 | | - }, |
28 | | - ], |
29 | | - }, |
30 | | - testEnvironment: "jsdom", |
31 | | - testEnvironmentOptions: { |
32 | | - customExportConditions: [""], |
33 | | - }, |
34 | | - testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", |
35 | | - testPathIgnorePatterns: [ |
36 | | - "/node_modules/", |
37 | | - "/e2e/", |
38 | | - // TODO: This test is timing out after upgrade a few Jest dependencies |
39 | | - // and I was not able to figure out why. When running it specifically, I |
40 | | - // can see many act warnings that may can help us to find the issue. |
41 | | - "/usePaginatedQuery.test.ts", |
42 | | - ], |
43 | | - transformIgnorePatterns: [ |
44 | | - "<rootDir>/node_modules/@chartjs-adapter-date-fns", |
45 | | - ], |
46 | | - moduleDirectories: ["node_modules", "<rootDir>/src"], |
47 | | - moduleNameMapper: { |
48 | | - "\\.css$": "<rootDir>/src/testHelpers/styleMock.ts", |
49 | | - "^@fontsource": "<rootDir>/src/testHelpers/styleMock.ts", |
50 | | - }, |
51 | | - }, |
52 | | - ], |
53 | | - collectCoverageFrom: [ |
54 | | - // included files |
55 | | - "<rootDir>/**/*.ts", |
56 | | - "<rootDir>/**/*.tsx", |
57 | | - // excluded files |
58 | | - "!<rootDir>/**/*.stories.tsx", |
59 | | - "!<rootDir>/_jest/**/*.*", |
60 | | - "!<rootDir>/api.ts", |
61 | | - "!<rootDir>/coverage/**/*.*", |
62 | | - "!<rootDir>/e2e/**/*.*", |
63 | | - "!<rootDir>/jest-runner.eslint.config.js", |
64 | | - "!<rootDir>/jest.config.js", |
65 | | - "!<rootDir>/out/**/*.*", |
66 | | - "!<rootDir>/storybook-static/**/*.*", |
67 | | - ], |
| 2 | + // Use a big timeout for CI. |
| 3 | + testTimeout: 20_000, |
| 4 | + maxWorkers: 8, |
| 5 | + projects: [ |
| 6 | + { |
| 7 | + displayName: "test", |
| 8 | + roots: ["<rootDir>"], |
| 9 | + setupFiles: ["./jest.polyfills.js"], |
| 10 | + setupFilesAfterEnv: ["./jest.setup.ts"], |
| 11 | + extensionsToTreatAsEsm: [".ts"], |
| 12 | + transform: { |
| 13 | + "^.+\\.(t|j)sx?$": [ |
| 14 | + "@swc/jest", |
| 15 | + { |
| 16 | + jsc: { |
| 17 | + transform: { |
| 18 | + react: { |
| 19 | + runtime: "automatic", |
| 20 | + importSource: "@emotion/react", |
| 21 | + }, |
| 22 | + }, |
| 23 | + experimental: { |
| 24 | + plugins: [["jest_workaround", {}]], |
| 25 | + }, |
| 26 | + }, |
| 27 | + }, |
| 28 | + ], |
| 29 | + }, |
| 30 | + testEnvironment: "jsdom", |
| 31 | + testEnvironmentOptions: { |
| 32 | + customExportConditions: [""], |
| 33 | + }, |
| 34 | + testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", |
| 35 | + testPathIgnorePatterns: [ |
| 36 | + "/node_modules/", |
| 37 | + "/e2e/", |
| 38 | + // TODO: This test is timing out after upgrade a few Jest dependencies |
| 39 | + // and I was not able to figure out why. When running it specifically, I |
| 40 | + // can see many act warnings that may can help us to find the issue. |
| 41 | + "/usePaginatedQuery.test.ts", |
| 42 | + ], |
| 43 | + transformIgnorePatterns: [ |
| 44 | + "<rootDir>/node_modules/@chartjs-adapter-date-fns", |
| 45 | + ], |
| 46 | + moduleDirectories: ["node_modules", "<rootDir>/src"], |
| 47 | + moduleNameMapper: { |
| 48 | + "\\.css$": "<rootDir>/src/testHelpers/styleMock.ts", |
| 49 | + "^@fontsource": "<rootDir>/src/testHelpers/styleMock.ts", |
| 50 | + }, |
| 51 | + }, |
| 52 | + ], |
| 53 | + collectCoverageFrom: [ |
| 54 | + // included files |
| 55 | + "<rootDir>/**/*.ts", |
| 56 | + "<rootDir>/**/*.tsx", |
| 57 | + // excluded files |
| 58 | + "!<rootDir>/**/*.stories.tsx", |
| 59 | + "!<rootDir>/_jest/**/*.*", |
| 60 | + "!<rootDir>/api.ts", |
| 61 | + "!<rootDir>/coverage/**/*.*", |
| 62 | + "!<rootDir>/e2e/**/*.*", |
| 63 | + "!<rootDir>/jest-runner.eslint.config.js", |
| 64 | + "!<rootDir>/jest.config.js", |
| 65 | + "!<rootDir>/out/**/*.*", |
| 66 | + "!<rootDir>/storybook-static/**/*.*", |
| 67 | + ], |
68 | 68 | }; |
0 commit comments