[장인혁] sprint9 & 10#142
Open
CodeinHyuk wants to merge 8 commits intocodeit-bootcamp-nodejs:장인혁from
Hidden character warning
The head ref may contain hidden characters: "\uc7a5\uc778\ud601-sprint9"
Open
Conversation
peterhyun1234
approved these changes
Mar 18, 2026
Collaborator
peterhyun1234
left a comment
There was a problem hiding this comment.
@CodeinHyuk 님, 안녕하세요!
이번 Sprint 9 & 10 테스트 미션 제출하시느라 고생 많으셨습니다 👋
Jest + Supertest 설정부터 통합 테스트, 유닛 테스트, 심화 요구사항까지 전체 스펙을 빠짐없이 완성하셨고, main.ts의 서버 분리나 secure 쿠키 플래그 추가 같은 테스트 외적인 개선도 함께 챙겨주신 점이 인상적이었습니다.
LGTM! (Looks Good To Me) 👍
이번 PR은 요구사항 완성도 + 테스트 구조 + 비즈니스 로직 검증 측면에서 전반적으로 잘 갖춰져 있어 LGTM 드립니다.
칭찬하고 싶은 점 ✨
-
테스트 환경 분리를 제대로 챙겼습니다
main.ts에require.main === module가드를 추가해 테스트 실행 시 서버가 자동으로 뜨지 않도록 처리한 점, 소켓 초기화도NODE_ENV !== 'test'로 분리한 점이 아주 좋습니다.cross-env NODE_ENV=test로 환경변수를 명시적으로 주입하는 스크립트 구성도 깔끔합니다.
-
Jest 커버리지 설정이 꼼꼼합니다
collectCoverage,coverageDirectory,collectCoverageFrom에서.d.ts와main.ts를 제외한 점까지 세심하게 처리됐습니다.setupFilesAfterEnv로 공통 teardown을setup.ts에 분리한 구조도 좋습니다.
-
productService 유닛 테스트의 비즈니스 로직 검증이 훌륭합니다
- 가격 변경 시 좋아요 유저들에게 알림을 전송하는 핵심 로직을,
findById/findLikers/update/notificationService.createAndSend네 가지 의존성을 모두 Spy로 모킹하고 호출 횟수와 인자까지 검증하셨습니다. - 단순히 "테스트가 통과한다"를 넘어서 "이 로직이 올바르게 동작한다"를 증명하는 테스트입니다. 심화 요구사항을 제대로 이해하고 작성하셨습니다.
- 가격 변경 시 좋아요 유저들에게 알림을 전송하는 핵심 로직을,
-
authController 보안 개선
- 쿠키에
secure: NODE_ENV === 'production'플래그를 추가해 프로덕션에서 HTTPS 전용 쿠키가 되도록 개선한 점도 좋습니다. 테스트 미션이라 그냥 넘어갈 수도 있는 부분인데 챙겨주셨습니다.
- 쿠키에
한 단계 더 성장하기 위한 제안 🌱
-
prisma.$disconnect()중복 호출tests/setup.ts에 이미prisma.$disconnect()가 있는데, 각 테스트 파일의afterAll에도 중복 호출되고 있습니다.setup.ts에서 한 번만 호출하고 나머지는 제거하면 됩니다.
-
testProductId의존성 문제- '상품 생성' 테스트가 실패하면 이후 수정 테스트에서
undefined로 요청이 나갑니다.beforeAll에서 미리 상품을 생성해두는 방식이 더 안전합니다.
beforeAll(async () => { const res = await request(app).post('/products').set('Cookie', authCookie).send({...}); testProductId = res.body.id; });
- '상품 생성' 테스트가 실패하면 이후 수정 테스트에서
-
article.test.ts - 테스트 데이터 정리 누락
afterAll에서'Test Article'만 삭제하는데, 수정 테스트에서 생성한'Update Test'게시글이 정리되지 않습니다.afterAll에 함께 포함시켜 주세요.
-
'존재하지 않는 게시글 조회' 테스트 위치
GET /articles/999999는 인증이 필요 없는 API인데'인증이 필요한 API'describe 블록 안에 있습니다. 올바른 블록으로 옮기면 테스트 구조가 더 명확해집니다.
-
엣지 케이스 보강
- 이미 가입된 이메일로 재가입 시
409, 잘못된 비밀번호로 로그인 시401같은 실패 케이스를 추가하면 커버리지가 더 탄탄해집니다. articleService.test.ts에 권한 없는 유저가 삭제 시도 시 에러가 발생하는지 검증하는 케이스도 추가해보세요.
- 이미 가입된 이메일로 재가입 시
총평 🚀
이번 PR은 테스트 환경 구성 → 통합 테스트 → 유닛 테스트 심화까지 요구사항을 완전히 달성한, 완성도 높은 제출물입니다.
특히 productService 유닛 테스트에서 비즈니스 로직의 핵심 흐름을 Spy로 꼼꼼하게 검증한 부분은 이번 미션의 백미였습니다.
고생 많으셨습니다! Merge 진행하겠습니다.
다음 스프린트도 기대할게요 💪
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sprint 9
미션 목표
기본 요구사항
심화 요구사항
Sprint 10
기본 요구사항
AWS S3 적용
AWS RDS 적용
AWS EC2에 Express 서버 배포하기
심화 요구사항
API 엔드포인트 주소: http://54.180.29.185