-
Notifications
You must be signed in to change notification settings - Fork 153
/
jest.config.js
68 lines (67 loc) · 1.78 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const path = require("path")
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)$": [
"@swc/jest",
{
jsc: {
parser: {
syntax: "typescript",
tsx: true,
decorators: true,
dynamicImport: true,
},
transform: {
react: {
runtime: "automatic",
},
},
experimental: {
plugins: [
["@swc/plugin-loadable-components", {}],
[
"@swc/plugin-styled-components",
{
ssr: true,
displayName: true,
},
],
[
"@swc/plugin-relay",
{
// Must be fully-resolved absolute path
rootDir: path.resolve(process.cwd(), "src"),
artifactDirectory: "__generated__",
language: "typescript",
},
],
],
},
},
},
],
},
watchPlugins: [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname",
],
workerIdleMemoryLimit: "500MB",
}