Matchers (Jest, RTL)
·
🎨 프론트엔드 공부/기타
📍참고 https://jestjs.io/docs/using-matchers Using Matchers · Jest Jest uses "matchers" to let you test values in different ways. This document will introduce some commonly used matchers. For the full list, see the expect API doc. jestjs.io 📍Matcher 란? ✅Jest에서 값을 다양한 방법으로 테스트하기 위해 사용 - a > b, a = b, a { expect(2 + 2).toBe(4); // 값이 같..
CRA 환경의 내장 testing 라이브러리
·
🎨 프론트엔드 공부/기타
📍참고 https://create-react-app.dev/docs/running-tests Running Tests | Create React App Note: this feature is available with react-scripts@0.3.0 and higher. create-react-app.dev 📍before test.. ✅뭘 테스트 할건지 명확히 정하기 - 특정 컴포넌트의 기능.. - 유저 입력.. ✅테스트 성공, 실패 여부를 어떤 기준으로 할 건지 정하기 - 일치하는 문자열을 출력.. 📍Create React App 환경의 내장 testing 라이브러리 설치된 것들 1) @testing-library/react : ReactDOM을 사용하여 테스트할 컴포넌트를 렌더링 (React Te..