-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathjest.config.js
More file actions
30 lines (30 loc) · 898 Bytes
/
Copy pathjest.config.js
File metadata and controls
30 lines (30 loc) · 898 Bytes
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
module.exports = {
preset: "ts-jest",
testEnvironment: "jsdom",
setupFiles: ["<rootDir>/jest.env.js"], // dotenv only
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"], // fetch polyfill, afterAll
testMatch: [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[tj]s?(x)",
"**/*.__tests__.[tj]s?(x)",
],
transform: {
"^.+\\.(t|j)sx?$": [
"ts-jest",
{
tsconfig: "<rootDir>/tsconfig.tests.json",
},
],
},
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
"^@external/dynamic-hero$":
"<rootDir>/src/components/dynamic-hero/src/index.ts",
"^@external/dynamic-hero/(.*)$":
"<rootDir>/src/components/dynamic-hero/src/$1",
"\\.(css|scss|sass)$": "<rootDir>/__mocks__/fileMock.js",
"\\.(svg)$": "<rootDir>/__mocks__/svgMock.js",
"^@upstash/redis$": "<rootDir>/__mocks__/@upstash/redis.js",
"^server-only$": "<rootDir>/__mocks__/server-only.ts",
},
};