Skip to content

test : added unit tests for github-rate-limit.ts - #2659

Closed
tmdeveloper007 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
tmdeveloper007:#2654
Closed

test : added unit tests for github-rate-limit.ts#2659
tmdeveloper007 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
tmdeveloper007:#2654

Conversation

@tmdeveloper007

Copy link
Copy Markdown

Closes #2654.

Summary of What Has Been Done:
Added comprehensive unit tests for the GitHub rate-limit detection helpers in src/lib/github-rate-limit.ts.

Changes Made:

  • Added test/github-rate-limit.test.ts with 18 test cases across 3 describe blocks
  • getGitHubRateLimitDetails(): 403 without quota exhaustion, 429 always triggers, 403 with exhausted quota, 403 with retry-after, missing reset header, non-numeric reset
  • throwIfGitHubRateLimited(): non-throwing cases, throwing cases for 403 and 429
  • githubRateLimitResponse(): non-rate-limit errors, null input, correct 429 response with rate limit body

Impact it Made:
Improves test coverage for GitHub API error handling used across metrics and sync features. Ensures rate-limit detection and graceful HTTP 429 responses are reliable.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:testing GSSoC type bonus: tests (+10 pts) and removed gssoc26 GSSoC 2026 contribution labels Jun 21, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Umbrella-io — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@github-actions github-actions Bot added the gssoc26 GSSoC 2026 contribution label Jun 21, 2026
@tmdeveloper007

Copy link
Copy Markdown
Author

This PR was closed as stale. It has not received updates or merges within the past 2 days. If this is still needed, please reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test : add unit tests for github-rate-limit.ts

1 participant