Skip to content

test: add unit tests for high-value uncovered functions#362

Merged
tomasz-tomczyk merged 2 commits intomainfrom
improve-coverage
Apr 25, 2026
Merged

test: add unit tests for high-value uncovered functions#362
tomasz-tomczyk merged 2 commits intomainfrom
improve-coverage

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

Summary

  • Adds tests for 12 previously uncovered pure/near-pure functions across share sync, comment anchoring, state management, and config
  • Focus on high-value logic: deduplication, line remapping, comment merging — areas where bugs would silently corrupt user data
  • Unit coverage: 58.6% → 60.1% (+1.5pp); combined with e2e on Codecov should reach ~63-64%

Test plan

  • go test -race ./... passes
  • No production code changed — test files only

🤖 Generated with Claude Code

Cover share sync logic (buildLocalIDSet, highestWebIndex,
mergeRepliesIntoComment, buildLocalFingerprints), comment anchoring
(findAnchorInLines, remapLines), state management (filterDeletedComments,
mergeReviewCommentRepliesAndState, countHunkStats, handleCritJSONDeleted),
and config defaults (CleanupOnApproveEnabled, defaultConfig).

Unit coverage: 58.6% → 60.1% (+1.5pp)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.58%. Comparing base (b62fbac) to head (0d5416c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #362      +/-   ##
==========================================
+ Coverage   60.95%   62.58%   +1.62%     
==========================================
  Files          18       18              
  Lines        7807     7807              
==========================================
+ Hits         4759     4886     +127     
+ Misses       2620     2499     -121     
+ Partials      428      422       -6     
Flag Coverage Δ
e2e 34.89% <ø> (ø)
unit 56.55% <ø> (+1.78%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tomasz-tomczyk tomasz-tomczyk merged commit 2852e5d into main Apr 25, 2026
6 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the improve-coverage branch April 25, 2026 11:56
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