-
Notifications
You must be signed in to change notification settings - Fork 3
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
[#29] msw 설정 #38
Conversation
close #29 한줄로 적으셔야 합니다! |
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.
환경설정 수고하셨습니다!
eslint 에러 핸들링 및 msw 세팅 중 이슈가 있으셨다고 했는데 해당 사항 공유해주시면 더 좋을것 같습니다!
src/pages/homePage/index.tsx
Outdated
const [placeName, setPlaceName] = useState<string>(""); | ||
const [placeLoc, setPlaceLoc] = useState<string>(""); | ||
const [placePic, setPlacePic] = useState<string>(""); | ||
const [rooms, setRooms] = useState<Room[]>([]); |
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.
eslint 확인해주시기 바랍니다!
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.
린트 에러 잡으시느라 수고하셨습니다!!
그리고 data 같은 경우는 핸들러 내에서도 사용할 수 있지만 저같은 경우는 data 폴더를 따로 빼서 사용하긴 했습니다!.. 이부분은 다들 어떤방식으로 사용했는지 궁금하네요
@@ -0,0 +1,65 @@ | |||
import { http, HttpResponse } from "msw"; |
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.
제가 그렇게 진행해본적이없어서 혹시 handler를 여러개만들어도 상관없는건가요?
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.
앗 죄송해요 여러개의 핸들러가 아니라 여러개의 req 경우 각각의 파일로 나눠서 사용하는 방법을 말하는 거였어용..! 그리고 기존과 같이 handers 배열에 담아서 사용하면 될 것 같아서요!
|
||
const queryClient = new QueryClient(); | ||
if (process.env.NODE_ENV === "development") { | ||
worker.start(); | ||
} |
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.
로컬에 .env 파일을 만들어서 NODE_ENV 값을 development로 줘야하나요?
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.
아니요 자동적으로 인식이되서 따로 설정 안해줘도 됩니다.
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 |
뭔가 package-lock.json이 틀어져서 그런가 playwright를 실행하기 위해 npm ci 를 실행하면 github action에서 에러가 나네요. |
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.
msw 설정하는게 쉽지 않군여... 고생하셨습니다!
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.
수고하셨습니다!
왠지 testing툴과 msw의 충돌도 있었던거 같은데 추후 해결 과제가 되겠네요! |
헉 지금 충돌나는거 제가 homepage에 작성한 부분 때문인 것 같은데 main에 있는거 덮어쓰셔도 됩니다! |
수고많으셨습니다! 각종 호환 에러와 싸움을 많이 하신거 같군여..ㅠㅠ |
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.
approve 를 했는데 풀려있네요..?
다시 확인했습니다!
Issue Number
close #29
⛳️ Task
✍️ Not
데이터를 따로 폴더를 만들어서 진행하는 것으로 변경하였습니다. 필요한 데이터 추가 후 handler.ts에 아래와같이 추가하여 사용하시면됩니다.
*더 자세한 참고사항은 msw공식문서 참고 바랍니다.
📸 Screenshot
📎 Reference