-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/fe-018: 단위 테스트 환경 구성 #9
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 자란다 자란다
#8 참고
체크 리스트
작업 내역
vitest
,react-testing-library
단위테스트 라이브러리 실행 환경 구성vitest
,react-testing-library
환경 설정eslint
설정provider
및 함수 구성API 모킹 도구 실행환경 구성(
json-server
)PR 시 단위테스트를 확인하는 action 구성
기타 불필요한 의존성 제거(
jest
,storybook
등)예시 테스트 코드들 작성
문제 상황과 해결
msw
를 통해 개발시 모킹된 API를 이용해 개발하고자 했으나 next 13 app 디렉토리 에서는 MSW가 지원되지 않고 있는 이슈가 존재msw
로 테스트 코드 환경상에서의 API 모킹은 가능하지만 브라우저 환경 및 서버사이드 환경에서 사용해야하는 API 모킹이 안되는 상황json-server
를 활용하는 방법은 세팅 완료 (yarn server:dev
)서버 컴포넌트는 반환값이
Promise<JSXElement>
여서 사용시 에디터 상에서 TS Error 발생비고
리액트 테스트 관련 자료 모음집