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

[#29] msw 설정 #38

Merged
merged 13 commits into from
Jan 5, 2024
Merged

[#29] msw 설정 #38

merged 13 commits into from
Jan 5, 2024

Conversation

chaeminseok
Copy link
Contributor

@chaeminseok chaeminseok commented Jan 4, 2024

Issue Number

close #29

⛳️ Task

  • 화이팅하기
  • msw 세팅 및 test

✍️ Not

image
데이터를 따로 폴더를 만들어서 진행하는 것으로 변경하였습니다. 필요한 데이터 추가 후 handler.ts에 아래와같이 추가하여 사용하시면됩니다.
image

*더 자세한 참고사항은 msw공식문서 참고 바랍니다.

📸 Screenshot

📎 Reference

@chaeminseok chaeminseok added the FEAT FEAT label Jan 4, 2024
@chaeminseok chaeminseok self-assigned this Jan 4, 2024
@wowba
Copy link
Contributor

wowba commented Jan 4, 2024

close #29 한줄로 적으셔야 합니다!

Copy link
Contributor

@wowba wowba left a comment

Choose a reason for hiding this comment

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

환경설정 수고하셨습니다!
eslint 에러 핸들링 및 msw 세팅 중 이슈가 있으셨다고 했는데 해당 사항 공유해주시면 더 좋을것 같습니다!

Comment on lines 15 to 18
const [placeName, setPlaceName] = useState<string>("");
const [placeLoc, setPlaceLoc] = useState<string>("");
const [placePic, setPlacePic] = useState<string>("");
const [rooms, setRooms] = useState<Room[]>([]);
Copy link
Contributor

Choose a reason for hiding this comment

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

eslint 확인해주시기 바랍니다!

Copy link
Contributor

@im-na0 im-na0 left a comment

Choose a reason for hiding this comment

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

린트 에러 잡으시느라 수고하셨습니다!!
그리고 data 같은 경우는 핸들러 내에서도 사용할 수 있지만 저같은 경우는 data 폴더를 따로 빼서 사용하긴 했습니다!.. 이부분은 다들 어떤방식으로 사용했는지 궁금하네요

@@ -0,0 +1,65 @@
import { http, HttpResponse } from "msw";
Copy link
Contributor

Choose a reason for hiding this comment

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

핸들러는 폴더를 따로 파서 거기서 각자 핸들러 설정하는건 어떨까요? 한 파일 내에서 핸들러 설정하면 너무 길어지기도 하고 충돌날 여지도 있을 것 같습니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

제가 그렇게 진행해본적이없어서 혹시 handler를 여러개만들어도 상관없는건가요?

Copy link
Contributor

Choose a reason for hiding this comment

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

앗 죄송해요 여러개의 핸들러가 아니라 여러개의 req 경우 각각의 파일로 나눠서 사용하는 방법을 말하는 거였어용..! 그리고 기존과 같이 handers 배열에 담아서 사용하면 될 것 같아서요!


const queryClient = new QueryClient();
if (process.env.NODE_ENV === "development") {
worker.start();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

로컬에 .env 파일을 만들어서 NODE_ENV 값을 development로 줘야하나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아니요 자동적으로 인식이되서 따로 설정 안해줘도 됩니다.

Copy link

github-actions bot commented Jan 4, 2024

Visit the preview URL for this PR (updated for commit 307c815):

https://percenthotel--pr38-feature-29-msw-sett-j56gwct3.web.app

(expires Fri, 12 Jan 2024 04:37:44 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 5f3aee9d8d8535dbb552ad12361bc813c5a90573

@wowba
Copy link
Contributor

wowba commented Jan 4, 2024

뭔가 package-lock.json이 틀어져서 그런가 playwright를 실행하기 위해 npm ci 를 실행하면 github action에서 에러가 나네요.
로컬에서 playwright가 정상적으로 동작하는지 확인 후 커밋 부탁드립니다!

Copy link
Contributor

@wowba wowba left a comment

Choose a reason for hiding this comment

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

msw 설정하는게 쉽지 않군여... 고생하셨습니다!

Copy link
Contributor

@Bumang-Cyber Bumang-Cyber left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

@Bumang-Cyber
Copy link
Contributor

왠지 testing툴과 msw의 충돌도 있었던거 같은데 추후 해결 과제가 되겠네요!

@im-na0
Copy link
Contributor

im-na0 commented Jan 5, 2024

헉 지금 충돌나는거 제가 homepage에 작성한 부분 때문인 것 같은데 main에 있는거 덮어쓰셔도 됩니다!
mockserviceworker에서 왜 린트에러가 나는지 그부분은 저도 찾아봐야겟네요,,

@Bumang-Cyber
Copy link
Contributor

수고많으셨습니다! 각종 호환 에러와 싸움을 많이 하신거 같군여..ㅠㅠ

Copy link
Contributor

@wowba wowba left a comment

Choose a reason for hiding this comment

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

approve 를 했는데 풀려있네요..?
다시 확인했습니다!

@chaeminseok chaeminseok merged commit ab1af59 into main Jan 5, 2024
@chaeminseok chaeminseok deleted the feature/#29-msw-setting branch January 5, 2024 09:00
@chaeminseok chaeminseok restored the feature/#29-msw-setting branch January 18, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FEAT FEAT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MSW setting
5 participants