eatthefrog
리엑트 테스트 코드 시작하기 본문
<종류>
- Manual Testing : Error-prone: It’s hard to test all posiible combiniations and scenarios
- Automated Testing: Very techinincal but allows you to test ALL building blocks at once
<Automated Testing: 종류>
- 유닛 테스트: The most common / important kind of test
- Test the inidivisual building blocks (funtions, components) in isolation
- Projects typically contain doaens or hundereds of unit testes
- 통합 테스트: Also imporant, but focus on unit tests in most cases
- Test the combiniation of multiple building blocks
- Projects typically contain a couple of integratin tests
- E2E 테스트: Imporant but can also be done maunually (partically)
- Test complete scenarios in you app as the user would expericnce them
- Procets typically contain only a few e2e thests
<무엇을 테스트할까요?>
- 무엇을?
- Test the different building blocks
- Unit TestsL The smallest building blocks that make up you app
- 어떻게?
- Test sucess and error cases, also test rare (but posiible) results
<추가적인 도구와 설정>
- We need a tool for running our tests and asserting the results (Jest)
- We need a tool for “simulating” (rendring) our React app / components (React Testing Library)
- //package.json "@testing-libarary/jest-dom" : "^5.11.6", "@testing-library/react": "^11.2.2", "@testing-library/user-event": ^12.5.0"
'프론트엔드 노트' 카테고리의 다른 글
| React Testing - Jest/Vitest/RTL (0) | 2025.12.02 |
|---|---|
| React Hooks 단위 테스트 도구 비교 (0) | 2025.12.02 |
| 리팩토링: React AppNavigation 상태 관리 (0) | 2025.11.25 |
| React-Native - Firebase Analytics 도입하기 (0) | 2025.11.19 |
| 리엑트 1000줄 리팩토링 하기 (0) | 2025.11.13 |