Skip to content

fix: only warn about incomplete coverage when tests were rerun (#85)#87

Merged
kjonescertinia merged 1 commit into
mainfrom
fix/85-coverage-warning
Jul 4, 2026
Merged

fix: only warn about incomplete coverage when tests were rerun (#85)#87
kjonescertinia merged 1 commit into
mainfrom
fix/85-coverage-warning

Conversation

@kjonescertinia

Copy link
Copy Markdown
Contributor

Summary

Fixes #85. The "coverage report may not be complete" warning fired on every run with coverage enabled, even clean single runs with no reruns.

getCoverage guarded the warning with:

if (store.runIds.length > 1 || store.reruns) {

store.reruns is a TestRerun[] initialised to [], so || store.reruns was always truthy. The warning is now gated on store.reruns.length > 0, so it only appears when tests were actually rerun (or the run spanned multiple run ids).

Changes

  • src/command/Testall.ts — check store.reruns.length > 0 instead of the always-truthy array reference.
  • test/command/Testall.spec.ts — regression tests: no warning on a clean run with coverage enabled and no reruns; warning still emitted when tests were rerun.
  • CHANGELOG.md — bullet under the unreleased 3.4.0 section.

Testing

  • pnpm build — clean
  • pnpm lint — clean
  • pnpm test — 101 passed (17 suites), including the 2 new regression tests

store.reruns is an array initialised to [], so the truthiness guard
in getCoverage was always true and the 'coverage report may not be
complete' warning fired on every run with coverage enabled. Check
store.reruns.length instead so the warning only appears when tests
were actually rerun or the run spanned multiple run ids.
@kjonescertinia kjonescertinia merged commit 74f11fa into main Jul 4, 2026
1 check passed
@kjonescertinia kjonescertinia deleted the fix/85-coverage-warning branch July 4, 2026 16:00
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.

Coverage incompleteness warning always fires when coverage is enabled

1 participant