test(commits): cover commit.mapper edge cases (42.9% → 100%)#79
Merged
Merged
Conversation
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>
Collaborator
|
These unit tests are great and increase overall test coverage. thank you for contributing |
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
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) →usermaps tonullwhile the git-level name/email are kept — the mapper's only conditional branches;urlcomes fromhtml_url, not the APIurl;Dateinstances (exact value asserted);verifiedtaken from theverificationblock (signed and unsigned);parentShas;mapCommitsover a list and over[].Coverage
commit.mapper.ts: 42.9% → 100% (statements, branches, functions, lines).Full suite: 196 passed, 0 regressions.
prettier --checkclean. Diff is the one test file only.🤖 Generated with Claude Code