-
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
[Feature] Deploy after changing to firestore #32
[Feature] Deploy after changing to firestore #32
Conversation
saseungmin
commented
Nov 28, 2020
•
edited
edited
- json-server에서 firestore로 변경
- firebase에 호스팅
- change from json-server to firestore
- firebase initial settings - deploy with firebase
const response = await db.collection('groups').get(); | ||
|
||
const groups = response.docs.map((doc) => ({ | ||
...doc.data(), | ||
id: doc.id, | ||
})); | ||
|
||
return groups; |
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.
해당 테스트를 왜 해야하나요? 이 부분을 테스트함으로써 어떤 확신을 얻을수 있을까요?
개인적으로는 API의 테스트가 굉장히 애매한것 같아요 ㅎㅎ 프론트보단 백엔드 쪽에서 API 기능 자체를 테스트 하는게 맞을 것같고, 만약 fetcher helper와 같이 프론트에서 처리를 해주는 부분이 있다면 그 부분은 프론트 테스트가 필요하겠죠.
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.
그렇군요.. 😢
아직 테스트를 작성하는데 있어서 부족함이 있는 거 같습니다.
리뷰 감사합니다!
const response = await db.collection('groups').doc(id).get(); | ||
|
||
if (!response.exists) { | ||
return null; | ||
} | ||
|
||
return response.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.
- 방법은 있는거 같은데 활용이 안된다.
|
드디어 동료분들께 공유할 수 있게 됐네요~ 👏👏👏 |