Summary of What Needs to be Done: Add unit tests for the utility functions in src/lib/github-rate-limit.ts: getGitHubRateLimitDetails, throwIfGitHubRateLimited, and githubRateLimitResponse.
Changes that Need to be Made: Create test/github-rate-limit.test.ts. Mock Response objects (with .status and .headers.get) to cover: 403/429 with remaining=0 and valid reset header, 403/429 with remaining=0 and missing reset header, 403/429 with remaining>0 (should return null), 200 OK (should return null), and NaN reset header. Also test that GitHubRateLimitError is correctly thrown and that githubRateLimitResponse produces the expected JSON shape.
Impact that it would Provide: This module is the first line of defense against rate limit exhaustion cascading through the app. Proper test coverage ensures the detection logic is correct and the error response shape stays stable across refactors.
Hello @Priyanshu-byte-coder, please assign this issue to me (@tmdeveloper007) so I can open a focused PR.
Summary of What Needs to be Done: Add unit tests for the utility functions in src/lib/github-rate-limit.ts: getGitHubRateLimitDetails, throwIfGitHubRateLimited, and githubRateLimitResponse.
Changes that Need to be Made: Create test/github-rate-limit.test.ts. Mock Response objects (with .status and .headers.get) to cover: 403/429 with remaining=0 and valid reset header, 403/429 with remaining=0 and missing reset header, 403/429 with remaining>0 (should return null), 200 OK (should return null), and NaN reset header. Also test that GitHubRateLimitError is correctly thrown and that githubRateLimitResponse produces the expected JSON shape.
Impact that it would Provide: This module is the first line of defense against rate limit exhaustion cascading through the app. Proper test coverage ensures the detection logic is correct and the error response shape stays stable across refactors.
Hello @Priyanshu-byte-coder, please assign this issue to me (@tmdeveloper007) so I can open a focused PR.