Conversation
f-lab-namu
reviewed
Dec 29, 2025
| inject: [ConfigService], | ||
| useFactory: async (config: ConfigService) => ({ | ||
| secret: config.get<string>('JWT_SECRET'), | ||
| signOptions: { expiresIn: '1d' }, |
There was a problem hiding this comment.
[tip / not issue] 1d 같은 부분은 설정으로 따로 빼면 좋습니다
|
|
||
| @Get(':id') | ||
| findOne(@Param('id', ParseIntPipe) id: number) { | ||
| return this.usersService.findOne(+id); |
| expect(result.password).toBe(hashedPassword); | ||
| }); | ||
|
|
||
| it('email 중복 체크', async () => { |
There was a problem hiding this comment.
테스트 코드 naming 을 할때에는 기대 결과와 조건 실제 상태등이 드러나는 이름으로 지으면 좋습니다.
키워드로 "테스트 코드 네이밍" 등을 검색해서 학습하신 후 본인이 선호되는 스타일로 이름을 다시 지어주세요~
|
|
||
| jest.mock('bcrypt'); | ||
|
|
||
| describe('UsersService', () => { |
| async create(createUserDto: CreateUserDto): Promise<User> { | ||
| const existingUser = await this.findByEmail(createUserDto.email); | ||
| if (existingUser) { | ||
| throw new ConflictException('이미 존재하는 이메일입니다.'); |
There was a problem hiding this comment.
다양한 status code 를 잘 활용하시는 부분이 좋습니다! 👍
|
https://docs.nestjs.com/pipes#providing-defaults 이 코드 예시를 보면 ParseIntPipe 를 적용하면 알아서 Number 로 되기 때문에 Number 생성자를 중복으로 쓰지 않아도 되지 않나요? |
f-lab-namu
approved these changes
Jan 5, 2026
|
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.


개요
로그인 및 회원가입 기능을 추가하고, 회원가입에 대한 기본 테스트 코드를 작성한 풀 리퀘스트입니다.
주요 변경 사항
기술적 구현 내용
추후 계획