Skip to content
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

Merged
merged 1 commit into from
Nov 16, 2024
Merged

Conversation

hyohyo12
Copy link
Collaborator

@hyohyo12 hyohyo12 commented Nov 15, 2024

📄 Summary

map fixture 작성
map 관련 레포지토리 테스트 작성했습니다.

🕰️ Actual Time of Completion

5

close #54

@hyohyo12 hyohyo12 self-assigned this Nov 15, 2024
@hyohyo12 hyohyo12 added BE 백엔드 관련 이슈입니다 👀 테스트 테스트를 작성하거나 수정합니다 labels Nov 15, 2024
@hyohyo12 hyohyo12 added this to the week3 milestone Nov 15, 2024
Copy link
Collaborator

@koomchang koomchang left a 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({});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: User 이 상태가 변하는 곳이 있나요? 지우는 이유가 있을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하 그러네요 잘 못 적은 것 같슽니다. 수정하겠습니다.

Comment on lines +27 to +30
afterAll(async () => {
await mapRepository.delete({});
await dataSource.getRepository(User).delete({});
await dataSource.destroy();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

생각해보니 afterAll에서 dataSource를 정리해주는 것은 필요하겠네요! 참고하겠습니다!

Copy link
Collaborator

@Miensoap Miensoap left a 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';
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵!! 수정해서 다음 service 테스트 PR 에 반영하겠습니다!

Comment on lines +13 to +17
let fakeUser1: User;
let fakeUser2: User;
beforeAll(async () => {
fakeUser1 = UserFixture.createUser({ oauthId: 'abc' });
fakeUser2 = UserFixture.createUser({ oauthId: 'def' });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q. 항상 유저 두명이 필요한가요?

그렇지 않고 특정 테스트의 조건이라면
테스트와 함께 작성하는 것이 나을 것 같아요

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 수정하겠습니다!

@hyohyo12 hyohyo12 merged commit f37fc3c into develop Nov 16, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE 백엔드 관련 이슈입니다 👀 테스트 테스트를 작성하거나 수정합니다
Projects
None yet
Development

Successfully merging this pull request may close these issues.

지도 예외 처리와 관련 테스트를 작성한다
3 participants