-
Notifications
You must be signed in to change notification settings - Fork 2
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
map 기능 레포지토리 테스트 작성 #129
map 기능 레포지토리 테스트 작성 #129
Conversation
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.
고생하셨습니다! 꼼꼼하게 잘 하셨네요!
container = await new MySqlContainer().withReuse().start(); | ||
dataSource = await initDataSource(container); | ||
mapRepository = new MapRepository(dataSource); | ||
await dataSource.getRepository(User).delete({}); |
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.
q: User
이 상태가 변하는 곳이 있나요? 지우는 이유가 있을까요?
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.
아하 그러네요 잘 못 적은 것 같슽니다. 수정하겠습니다.
afterAll(async () => { | ||
await mapRepository.delete({}); | ||
await dataSource.getRepository(User).delete({}); | ||
await dataSource.destroy(); |
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.
생각해보니 afterAll
에서 dataSource
를 정리해주는 것은 필요하겠네요! 참고하겠습니다!
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.
LGTM
@@ -0,0 +1,9 @@ | |||
import { User } from '../../../src/user/entity/user.entity'; |
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.
p3. path alias 설정해 두었으니 사용해 주세요! ( 다른 파일도 동일 )
@src/user/entity/user.entity
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.
넵!! 수정해서 다음 service 테스트 PR 에 반영하겠습니다!
let fakeUser1: User; | ||
let fakeUser2: User; | ||
beforeAll(async () => { | ||
fakeUser1 = UserFixture.createUser({ oauthId: 'abc' }); | ||
fakeUser2 = UserFixture.createUser({ oauthId: 'def' }); |
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.
q. 항상 유저 두명이 필요한가요?
그렇지 않고 특정 테스트의 조건이라면
테스트와 함께 작성하는 것이 나을 것 같아요
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.
넵 수정하겠습니다!
1335d0a
to
c617348
Compare
📄 Summary
🕰️ Actual Time of Completion
close #54