Skip to content
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

feat: 스토어 구현 #7

Merged
merged 2 commits into from
Jun 28, 2023
Merged

feat: 스토어 구현 #7

merged 2 commits into from
Jun 28, 2023

Conversation

ShinjungOh
Copy link
Owner

@ShinjungOh ShinjungOh commented Jun 26, 2023

작업 내용


  • zustand로 스토어 구현하기

화면 스크린샷 (optional)

zustand 상태 관리 스토어 적용 브라우저 및 IDE 화면

스크린샷 2023-06-27 오전 7 24 25
  • 화면에 count가 표시되지 않는 이슈 -> zustand 사용법을 제대로 익히지 못해 발생한 문제 (해결)

Husky 실행 시 test 오류

스크린샷 2023-06-27 오전 7 27 41
  • store를 생성하고 커밋을 시도하면 허스키의 npm run test 명령에서 오류가 발생합니다.
  • prettier:check를 실행해 검사 시 아무런 문제가 없습니다.
  • npm run test를 실행했을 때 모든 테스트가 통과합니다.
  • 당장의 경우는 git commit -m "커밋 메시지" --no-verify 명령어로 허스키를 실행하지 않고 커밋 푸시 했습니다.

참고 문서 (optional)

스크린샷 2023-06-27 오전 7 35 37
  • jset를 사용하고 오류가 발생한 비슷한 경우가 있는 것을 확인했습니다.

@bytrustu
Copy link
Collaborator

bytrustu commented Jun 26, 2023

P2:
남겨주신 내용 잘 확인했습니다.

lint-staged 수행중에 반영 된 코드에서 테스트 할 파일을 찾기 못해서 발생한 것 같습니다.

jest의 경우에는 spec, test 파일 패턴으로 테스트 파일을 찾게되는데 일치하는 파일이 없어서 테스트가 실패한 것 같네요.
위에 명령어가 명시 된 것 처럼 --passWithNoTests 옵션을 script -> jest에 추가하면 해결 될 것 같습니다.

{
  "scripts": {
    "test": "jest --silent --passWithNoTests"
  }
}

image

@ShinjungOh ShinjungOh requested a review from bytrustu June 26, 2023 23:07
@ShinjungOh
Copy link
Owner Author

말씀하신대로 package.json에서 test 명령어에 --passWithNoTests 를 붙이니까 husky 문제가 해결되었습니다! counterStore 제대로 적용해서 커밋 올려두었습니다.

Copy link
Collaborator

@bytrustu bytrustu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스토어 잘 적용되었네요.
프로젝트에서 어떤 데이터를 스토어에 활용할지 고민해보고 활용해보면 좋겠습니다.

@ShinjungOh ShinjungOh merged commit d087168 into main Jun 28, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants