Skip to content

Cover the action entrypoint in Vitest coverage#853

Merged
kitsuyui merged 1 commit into
mainfrom
queue/metric-audit-001
Jul 13, 2026
Merged

Cover the action entrypoint in Vitest coverage#853
kitsuyui merged 1 commit into
mainfrom
queue/metric-audit-001

Conversation

@kitsuyui

Copy link
Copy Markdown
Owner

Summary

Cover the action entrypoint in Vitest coverage

Add a dedicated src/index.spec.ts that imports the action entrypoint under
mocks and exercises the reachable src/index.ts branches for the normal
path, legacy input aliases, invalid max-expected-occurrences, and
downstream failure handling. Make Vitest coverage explicitly include
src/**/*.ts while excluding *.spec.ts so the published coverage report
keeps the action entrypoint visible even when it is only reached through
import-time execution.

Chosen fix

  • approach: surface-add-index-spec-and-explicit-coverage-include
    This is the smallest safe plan that fixes the finding at its source: the
    published coverage should represent the real action entrypath. It stays
    within the repo's existing Vitest coverage setup, avoids repository-settings
    changes, does not weaken any quality gate, and does not require a broader
    refactor of action orchestration. Adding only coverage inclusion would
    expose the gap but leave the main path untested; adding only tests would
    cover today's file but still rely on implicit inclusion behavior. Doing
    both keeps the change local and durable.

@github-actions

Copy link
Copy Markdown

🎉 Happy commit!

@github-actions

Copy link
Copy Markdown

gh-counter

PR gate

Removed Added +/-
TODO/FIXME 0 0 0

Repo dashboard

main (4ff7c64) #853 (bb326f1) +/-
TODO/FIXME 0 0 0

Reported by gh-counter

@github-actions

Copy link
Copy Markdown

Code Metrics Report

main (4ff7c64) #853 (bb326f1) +/-
Coverage 99.2% 97.6% -1.7%
Code to Test Ratio 1:1.3 1:1.6 +0.2
Test Execution Time 1s 1s 0s
Details
  |                     | main (4ff7c64) | #853 (bb326f1) |  +/-  |
  |---------------------|----------------|----------------|-------|
- | Coverage            |          99.2% |          97.6% | -1.7% |
  |   Files             |              5 |              7 |    +2 |
  |   Lines             |            134 |            170 |   +36 |
+ |   Covered           |            133 |            166 |   +33 |
+ | Code to Test Ratio  |          1:1.3 |          1:1.6 |  +0.2 |
  |   Code              |            714 |            714 |     0 |
+ |   Test              |            966 |           1180 |  +214 |
  | Test Execution Time |             1s |             1s |    0s |

Code coverage of files in pull request scope (0.0% → 91.6%)

Files Coverage +/- Status
src/index.ts 91.6% +91.6% affected

Reported by octocov

@kitsuyui kitsuyui merged commit c70b583 into main Jul 13, 2026
5 checks passed
@kitsuyui kitsuyui deleted the queue/metric-audit-001 branch July 13, 2026 01:35
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