-
Notifications
You must be signed in to change notification settings - Fork 153
/
jest.config.js
37 lines (35 loc) · 1.1 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
const swcConfig = require("./.swcrc.js")
const { webpackEnv } = require("./webpack/webpackEnv")
if (webpackEnv.experimentalSWCCompiler) {
console.log("[jest.config.js] Experimental SWC Compiler is enabled.\n")
}
module.exports = {
cacheDirectory: ".cache/jest",
moduleDirectories: ["node_modules", "<rootDir>/src"],
moduleFileExtensions: ["js", "json", "jsx", "ts", "tsx"],
moduleNameMapper: {
"^luxon$": "<rootDir>/node_modules/luxon",
"^react$": "<rootDir>/node_modules/react",
},
reporters: ["default", "jest-junit"],
setupFilesAfterEnv: [
"<rootDir>/src/Utils/jestShim.js",
"<rootDir>/src/tests.ts",
],
testEnvironment: "jest-environment-jsdom",
testMatch: ["**/src/**/*.jest.(ts|tsx|js|jsx)"],
testEnvironmentOptions: {
url: "http://localhost",
},
transform: {
"\\.(gql|graphql)$": "@graphql-tools/jest-transform",
"(ts|tsx|js|jsx)$": webpackEnv.experimentalSWCCompiler
? ["@swc/jest", swcConfig]
: "babel-jest",
},
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname",
],
workerIdleMemoryLimit: "500MB",
}