-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjest.config.ts
More file actions
33 lines (30 loc) · 958 Bytes
/
jest.config.ts
File metadata and controls
33 lines (30 loc) · 958 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
const nextJest = require('next/jest')
const createJestConfig = nextJest({
dir: './',
})
const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts','<rootDir>/test/__mocks__/setupMocks.tsx'],
testEnvironment: 'jest-environment-jsdom',
testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
transform: {
'^.+\\.(ts|tsx)$': 'babel-jest',
},
transformIgnorePatterns: [
'node_modules/(?!(lucide-react)/)', // lucide-react는 변환 예외
],
collectCoverageFrom: [
'src/app/**/*.{js,jsx,ts,tsx}',
'!src/app/**/_*.{js,jsx,ts,tsx}',
'!src/app/**/layout.{js,jsx,ts,tsx}',
'!src/app/**/page.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/node_modules/**',
],
collectCoverage: true,
coverageDirectory: "coverage",
coverageReporters: ["text", "text-summary", "lcov"],
}
module.exports = createJestConfig(customJestConfig)