Skip to content

test: add unit coverage for collect-inputs, update-with-branch, post-buffered & update-comment-link#1444

Open
mateuscmtropical wants to merge 1 commit into
anthropics:mainfrom
mateuscmtropical:test/github-coverage-batch-4
Open

test: add unit coverage for collect-inputs, update-with-branch, post-buffered & update-comment-link#1444
mateuscmtropical wants to merge 1 commit into
anthropics:mainfrom
mateuscmtropical:test/github-coverage-batch-4

Conversation

@mateuscmtropical

Copy link
Copy Markdown
Contributor

Summary

Adds 47 unit tests across four previously-untested modules, plus a small testability refactor.

Module Function(s) under test Tests Mutation score
src/entrypoints/collect-inputs.ts collectActionInputsPresence() 8 100% (49/49)
src/github/operations/comments/update-with-branch.ts updateTrackingComment() 5 100% (14/14)
src/entrypoints/post-buffered-inline-comments.ts classifyComments(), postComment() 14 98.8% (83/84)
src/entrypoints/update-comment-link.ts updateCommentLink() 20 92.7% (115/124)

All four target modules go from no direct test to 100% line coverage.

Testability refactor

post-buffered-inline-comments.ts:

  • classifyComments and postComment are now exported.
  • The entrypoint side effect is guarded with if (import.meta.main) so importing the module for tests no longer runs main().

Verification

  • bun test — 47 pass, 0 fail (169 expect calls)
  • bun run typecheck — clean
  • prettier --check — clean

🤖 Generated with Claude Code

…buffered, update-comment-link

Adds 47 unit tests across four previously-untested modules:

- collect-inputs.ts: collectActionInputsPresence() env parsing (100% mutation)
- comments/update-with-branch.ts: updateTrackingComment() branch-link logic (100% mutation)
- entrypoints/post-buffered-inline-comments.ts: classifyComments() + postComment()
- entrypoints/update-comment-link.ts: updateCommentLink() full flow

post-buffered-inline-comments.ts is refactored for testability: classifyComments
and postComment are exported, and the entrypoint side effect is guarded with
`if (import.meta.main)` so importing the module does not run main().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant