Repository navigation
Expand file tree
/
Copy pathjest.config.js
More file actions
53 lines (53 loc) · 1.67 KB
/
Copy pathjest.config.js
File metadata and controls
53 lines (53 loc) · 1.67 KB
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
export default {
testEnvironment: "jsdom",
setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
moduleNameMapper: {
"^@/config/env$": "<rootDir>/src/config/__mocks__/env.ts",
"^@/(.*)$": "<rootDir>/src/$1",
"^components/(.*)$": "<rootDir>/src/components/$1",
"^locales/(.*)$": "<rootDir>/src/locales/$1",
"^locals/(.*)$": "<rootDir>/locals/$1",
"^pages/(.*)$": "<rootDir>/src/pages/$1",
"^constants/(.*)$": "<rootDir>/src/constants/$1",
"^hooks/(.*)$": "<rootDir>/src/hooks/$1",
"^store/(.*)$": "<rootDir>/src/store/$1",
"^@/config/env$": "<rootDir>/src/config/__mocks__/env.ts",
"\\.(css|less|scss|sass)$": "identity-obj-proxy",
"\\.(svg|png|jpg|jpeg|gif)$": "<rootDir>/__mocks__/fileMock.js",
},
transform: {
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
useESM: true,
tsconfig: {
jsx: "react-jsx",
esModuleInterop: true,
allowSyntheticDefaultImports: true,
target: "ES2022",
lib: ["ES2022", "DOM", "DOM.Iterable"],
module: "ESNext",
moduleResolution: "bundler",
strict: true,
skipLibCheck: true,
types: ["jest", "@testing-library/jest-dom", "node"],
},
},
],
},
extensionsToTreatAsEsm: [".ts", ".tsx"],
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
testMatch: [
"<rootDir>/src/**/__tests__/**/*.(ts|tsx)",
"<rootDir>/src/**/*.(test|spec).(ts|tsx)",
],
collectCoverageFrom: ["src/**/*.{ts,tsx}", "!src/**/*.d.ts"],
globals: {
"import.meta": {
env: {
VITE_API_BASE_URL: "http://localhost:3000",
VITE_API_URL: "http://localhost:3000",
},
},
},
};