-
Notifications
You must be signed in to change notification settings - Fork 0
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
test: 클래스 커스텀훅 테스트 코드 #274
Conversation
|
||
// mocking useParams | ||
const mockUseParams = (classId?: string, subClassId?: string) => { | ||
vi.doMock('react-router-dom', () => ({ |
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.
오 doMock
이라는 것도 있었네요. 배워갑니다!!
const setUser = (role: string | undefined) => { | ||
vi.doMock('@/stores', () => ({ | ||
default: () => ({ role }), | ||
})); | ||
}; |
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.
오오.. 저는 지금 로컬에 store를 그냥 테스트에 직접 가져와서 mock data 넣고, 접근하는 방식의 코드로 커밋했는데 이게 훨씬 좋아 보이네요 👍👍
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.
테스트 케이스가 엄청 많네요 수고하셨습니다! 테스트 코드 공부가 끝이 없네요......
📝 개요
클래스 커스텀훅 테스트 코드
🚀 변경사항
🔗 관련 이슈
#231
➕ 기타