Skip to content

Schedule: Add unit tests to app/dashboard/file-coverage/utils/get-metric-header.ts#796

Open
gitauto-ai[bot] wants to merge 4 commits intomainfrom
gitauto/schedule-20260416-075051-UYPj
Open

Schedule: Add unit tests to app/dashboard/file-coverage/utils/get-metric-header.ts#796
gitauto-ai[bot] wants to merge 4 commits intomainfrom
gitauto/schedule-20260416-075051-UYPj

Conversation

@gitauto-ai
Copy link
Copy Markdown
Contributor

@gitauto-ai gitauto-ai bot commented Apr 16, 2026

Current Coverage for app/dashboard/file-coverage/utils/get-metric-header.ts

  • Line Coverage: 0%
  • Statement Coverage: 0%
  • Function Coverage: 0% (Uncovered: L6:getMetricHeader)
  • Branch Coverage: 0% (Uncovered: line 7, block 0, branch 0, line 7, block 0, branch 1, line 7, block 0, branch 2, line 7, block 0, branch 3, line 7, block 0, branch 4)

Instructions

Focus on covering the uncovered areas.

Test these changes locally

git fetch origin
git checkout gitauto/schedule-20260416-075051-UYPj
git pull origin gitauto/schedule-20260416-075051-UYPj

What I Tested

I added tests for getMetricHeader in get-metric-header.test.ts, covering all four valid Metric union values (size, statement, function, branch) and the default/fallback branch using an invalid cast ("unknown" as Metric). The fallback asserts "Stmt" is returned, matching the switch default in the implementation.

Potential Bugs Found

None found.

Reviewer Notes

Confirm the switch default in get-metric-header.ts actually returns "Stmt" — the fallback test depends on this. If the default ever changes or throws, that test will catch it.

@gitauto-ai gitauto-ai bot requested a review from hiroshinishio April 16, 2026 07:50
@gitauto-ai gitauto-ai bot added the gitauto label Apr 16, 2026
@gitauto-ai
Copy link
Copy Markdown
Contributor Author

gitauto-ai bot commented Apr 16, 2026

Pull request completed! 🚀

I autonomously open pull requests on a schedule. You can manage your schedule here. Should you have any questions or wish to change settings or limits, please feel free to contact info@gitauto.ai or invite us to Slack Connect.

gitauto-ai bot and others added 3 commits April 16, 2026 07:52
…kip ci]

Co-Authored-By: hiroshinishio <hiroshinishio@users.noreply.github.com>
…get-metric-header.test.ts [skip ci]

Co-Authored-By: hiroshinishio <hiroshinishio@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants