Skip to content

Commit f00f7bd

Browse files
authored
Merge pull request #17 from frontend-opensource-project/URH-32/test-setting
[URH-32] 테스트 환경 셋팅 신규
2 parents 6f1bbd0 + 92f31d4 commit f00f7bd

7 files changed

+7502
-2383
lines changed

jest.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { JestConfigWithTsJest } from 'ts-jest';
2+
3+
const config: JestConfigWithTsJest = {
4+
verbose: true,
5+
testEnvironment: 'jsdom',
6+
transform: {
7+
'^.+\\.(ts|tsx)$': ['ts-jest', { tsconfig: 'tsconfig.spec.json' }],
8+
},
9+
moduleNameMapper: {
10+
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
11+
},
12+
setupFilesAfterEnv: ['./jest.setup.ts'],
13+
};
14+
15+
export default config;

jest.setup.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import '@testing-library/jest-dom/jest-globals';
2+
import { cleanup } from '@testing-library/react';
3+
4+
beforeAll(() => {
5+
console.log('🌟 Running setup before all tests...');
6+
});
7+
8+
afterAll(() => {
9+
console.log('🔚 Running teardown after all tests...');
10+
cleanup();
11+
});

0 commit comments

Comments
 (0)