본문 바로가기
Frontend#Frontend#Testing조회 1

Testing Library란?

정의

사용자 관점 중심의 테스트 라이브러리. React·Vue·Angular 모두 버전 제공.

Testing Library란?

"사용자가 보는 것처럼" 테스트를 작성하게 유도한다.

const button = screen.getByRole('button', {name: /저장/});
await userEvent.click(button);
expect(screen.getByText('완료')).toBeInTheDocument();

구현 세부(클래스명·내부 state) 의존을 배제.

📘 관련 기술노트

전체 보기 →

🔗 함께 보면 좋은 용어

Frontend 전체 →