Skip to content

test(pull-requests): cover service and mapper edge cases (→ 100%)#83

Merged
LewieJ08 merged 1 commit into
lujax-dev:mainfrom
Cryptoteep:test/pull-request-coverage
Jul 10, 2026
Merged

test(pull-requests): cover service and mapper edge cases (→ 100%)#83
LewieJ08 merged 1 commit into
lujax-dev:mainfrom
Cryptoteep:test/pull-request-coverage

Conversation

@Cryptoteep

Copy link
Copy Markdown
Contributor

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 into Commit/PullRequestFile;
  • merge — PUT payload (commit_title, merge_method) and passthrough response;
  • updateBranch — with expected_head_sha and 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: null for 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 --check clean. Diff is the two test files only.

🤖 Generated with Claude Code

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
LewieJ08 self-requested a review July 10, 2026 14:12

@LewieJ08 LewieJ08 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are we able to fix the pull request description going forward as it currently just says "What"

@LewieJ08
LewieJ08 merged commit 0e1a262 into lujax-dev:main Jul 10, 2026
2 checks passed
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.

Improve test coverage for PullRequestService.ts / pull-request.mapper.ts

2 participants