Skip to content

Add Istanbul coverage checking to jest test runner#2283

Merged
hiroshinishio merged 1 commit intomainfrom
wes
Feb 19, 2026
Merged

Add Istanbul coverage checking to jest test runner#2283
hiroshinishio merged 1 commit intomainfrom
wes

Conversation

@hiroshinishio
Copy link
Collaborator

@hiroshinishio hiroshinishio commented Feb 19, 2026

Summary

  • Integrate Istanbul (babel for jest, istanbul for vitest) coverage collection into run_jest_test - V8 inflates branch counts in single-file mode, Istanbul gives consistent AST-based results
  • Parse coverage-final.json and report uncovered statements, branches, functions, and lines back to the agent so it can fix gaps
  • Add target: Literal["issue", "pr"] to create_comment and move CREATE_COMMENT tool definition to create_comment.py
  • Format coverage results as a PR comment table via format_coverage_comment
  • Add pull_number to BaseArgs for PR-targeted comments from verify_task_is_complete

Social Media Post (GitAuto)

When we asked our agent to write tests for uncovered branches, it ran them, they passed, and it called it done. But the tests didn't actually cover the target branches. V8's coverage inflates numbers in single-file mode. Switched to Istanbul's AST-based instrumentation. Now we parse the real coverage JSON and tell the agent exactly which lines and branches it missed.

Social Media Post (Wes)

Tests passed but coverage didn't improve. V8 counts branches differently when running a single test file vs the full suite. Istanbul doesn't have this problem - it instruments the AST directly. Now the agent gets a coverage report with specific uncovered lines after each test run. All green isn't enough if the target branches are still uncovered.

When impl_file_to_collect_coverage_from is set, run jest/vitest with
Istanbul (babel/istanbul) instead of V8 for accurate single-file branch
coverage. Parse coverage-final.json and surface uncovered statements,
branches, functions, and lines.

Also add target parameter to create_comment for issue vs PR commenting,
move CREATE_COMMENT tool definition to create_comment.py, and add
pull_number to BaseArgs for PR-targeted comments.
@hiroshinishio hiroshinishio self-assigned this Feb 19, 2026
@hiroshinishio hiroshinishio merged commit d01004c into main Feb 19, 2026
1 check passed
@hiroshinishio hiroshinishio deleted the wes branch February 19, 2026 22:46
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