Skip to content

test(commits): cover commit.mapper edge cases (42.9% → 100%)#79

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

test(commits): cover commit.mapper edge cases (42.9% → 100%)#79
LewieJ08 merged 1 commit into
lujax-dev:mainfrom
Cryptoteep:test/commit-mapper-coverage

Conversation

@Cryptoteep

Copy link
Copy Markdown
Contributor

What

Adds tests/unit/modules/commits/commit.mapper.test.ts (11 tests), following the pattern of the existing mapper tests (issue.mapper.test.ts). Closes #78.

Covered edge cases:

  • author: null / committer: null (commit identity not linked to a GitHub account) → user maps to null while the git-level name/email are kept — the mapper's only conditional branches;
  • url comes from html_url, not the API url;
  • author/committer date strings → Date instances (exact value asserted);
  • verified taken from the verification block (signed and unsigned);
  • merge commit (two parents) and root commit (no parents) → parentShas;
  • mapCommits over a list and over [].

Coverage

commit.mapper.ts: 42.9% → 100% (statements, branches, functions, lines).

Full suite: 196 passed, 0 regressions. prettier --check clean. Diff is the one test file only.

🤖 Generated with Claude Code

Bring commit.mapper.ts from 42.9% to 100% coverage: null author or
committer accounts (git identity kept, user null), html_url vs API
url, date string -> Date conversion, verification.verified, merge and
root-commit parents, and mapCommits on empty input.

Closes lujax-dev#78

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@LewieJ08

Copy link
Copy Markdown
Collaborator

These unit tests are great and increase overall test coverage. thank you for contributing

@LewieJ08
LewieJ08 merged commit 6f43606 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 commit.mapper.ts (currently 42.9%)

2 participants