Skip to content

Test: 페이지네이션 유틸 테스트 #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

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open

Test: 페이지네이션 유틸 테스트 #3

wants to merge 38 commits into from

Conversation

makepin2r
Copy link
Collaborator

변경 사항

  • 테스트 패키지 추가 (Jest)
    • TS 환경에서 Jest 구동을 위한 추가 패키지 포함
  • 테스트 케이스 설명 문서 추가 (/docs/test-case-pagination.md)
  • 테스트 코드 추가 (/test/pagination.test.ts)
    • 현재는 테스트 케이스 문서 내의 TC1만 진행하였습니다.

기타

  • 원래는 feature 브랜치와 무관하게 test 브랜치에서 PR 올리려 했는데, 코드 리뷰 후 paginate() 에 변동이 생겨 feature -> test 브랜치로 pull 받은 상태입니다.
    • (참고) 본래 해당 범위는 아래와 같습니다.
      • test/pagination.test.ts
      • docs/test-case-pagination.md
      • jest.config.ts
      • package.json
      • tsconfig.json

makepin2r added 30 commits July 17, 2025 00:41
@makepin2r makepin2r requested a review from f-lab-stella July 18, 2025 14:20
@makepin2r makepin2r self-assigned this Jul 18, 2025
Copy link

Copy link

@f-lab-stella f-lab-stella left a comment

Choose a reason for hiding this comment

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

vite를 사용하셨다면 vitest를 사용하는 방법도 있습니다~


const data = Array.from({ length: 10 }, (_, i) => i + 1); // [1,2,...,10]

describe("TC1. page > 0, size> 0일 경우 올바른 항목을 반환한다.", () => {

Choose a reason for hiding this comment

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

TC1과 같은 prefix는 제거해도 될것같아용~

Choose a reason for hiding this comment

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

'올바른 항목' 은 어떤걸 의미할까요? 테스트 시나리오 제목만 보고 테스트를 유추하기에는 어려운 단어인 것 같아요 ㅠㅠ

Comment on lines +8 to +29
const testCases: [number, number, number[]][] = [
[1, 1, [1]],
[2, 1, [2]],
[10, 1, [10]],
[1, 2, [1, 2]],
[2, 2, [3, 4]],
[3, 2, [5, 6]],
[4, 2, [7, 8]],
[5, 2, [9, 10]],
[1, 4, [1, 2, 3, 4]],
[2, 4, [5, 6, 7, 8]],
[3, 4, [9, 10]],
[1, 6, [1, 2, 3, 4, 5, 6]],
[2, 6, [7, 8, 9, 10]],
[1, 7, [1, 2, 3, 4, 5, 6, 7]],
[2, 7, [8, 9, 10]],
[1, 8, [1, 2, 3, 4, 5, 6, 7, 8]],
[2, 8, [9, 10]],
[1, 9, [1, 2, 3, 4, 5, 6, 7, 8, 9]],
[2, 9, [10]],
[1, 10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]],
];

Choose a reason for hiding this comment

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

어떤 기준으로 test case가 생성된 걸 까요?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants