-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.js
More file actions
35 lines (33 loc) · 935 Bytes
/
jest.config.js
File metadata and controls
35 lines (33 loc) · 935 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
31
32
33
34
35
module.exports = {
preset: "ts-jest",
testEnvironment: "jsdom",
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
transform: {
"^.+\\.(ts|tsx)$": [
"ts-jest",
{ tsconfig: { jsx: "react-jsx" } }, // JSX 변환 보장
],
"^.+\\.svg$": "jest-transformer-svg", // SVG 변환 추가
},
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/src/$1",
"\\.module\\.(css|scss|sass)$": "identity-obj-proxy",
"\\.(css|scss|sass|less)$": "<rootDir>/src/mock/styleMock.js", // global CSS (swiper/css 등)
},
testPathIgnorePatterns: ["<rootDir>/tests/e2e/"],
testMatch: ["**/?(*.)+(test|spec).(ts|tsx)"],
reporters: [
"default",
[
"jest-junit",
{
outputDirectory: "test-results",
outputName: "junit.xml",
addFileAttribute: "true",
},
],
],
collectCoverage: true,
collectCoverageFrom: ["src/**/*.{ts,tsx}"],
coverageDirectory: "coverage",
};