test(pull-requests): cover service and mapper edge cases (→ 100%)#83
Merged
Merged
Conversation
Bring PullRequestService.ts (60.5%) and pull-request.mapper.ts (75%) to 100% coverage: create/update/merge payload mapping and endpoints, listCommits/listFiles mapping, updateBranch with and without expected_head_sha, null patch on large/binary files, and the camelCase -> snake_case params mappers. Closes lujax-dev#81 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
LewieJ08
self-requested a review
July 10, 2026 14:12
LewieJ08
approved these changes
Jul 10, 2026
LewieJ08
left a comment
Collaborator
There was a problem hiding this comment.
Are we able to fix the pull request description going forward as it currently just says "What"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #81. Targets exactly the uncovered lines from the coverage report rather than duplicating existing tests:
PullRequestService.test.ts(+8 tests) — the six untested methods:create— POST endpoint + camelCase→snake_case payload, mapped return;update— PATCH endpoint + payload;listCommits/listFiles— endpoints + mapping intoCommit/PullRequestFile;merge— PUT payload (commit_title,merge_method) and passthrough response;updateBranch— withexpected_head_shaand without (omitted →{}).pull-request.mapper.test.ts(new file, 7 tests) — the param/file mappers the service tests can't reach in isolation:mapPullRequestFile(incl.patch: nullfor large/binary files),mapPullRequestFiles(incl. empty array),mapCreatePullRequestParams,mapUpdatePullRequestParams,mapMergePullRequestParams.Coverage
PullRequestService.ts: 60.5% → 100%pull-request.mapper.ts: 75% → 100% (statements, branches, functions, lines)Full suite: 211 passed, 0 regressions.
prettier --checkclean. Diff is the two test files only.🤖 Generated with Claude Code