test(cli-app): close the branch-coverage gap and add the package to CI - #2402
test(cli-app): close the branch-coverage gap and add the package to CI#2402aryanku-dev wants to merge 1 commit into
Conversation
@percy/cli-app was the only one of 18 packages missing from both the test.yml and windows.yml matrices, so its 81 specs have never run in CI on any platform. Adding it as-is would have turned CI red: the package sits at 98.44% branch coverage against the repo's 100% threshold. The gap is `err.code || err.message`, interpolated into the warning at maestro-inject.js:157 and the debug line at :273. Every existing spec throws an error carrying a code (EACCES, EROFS, EEXIST, ENOENT), so the `err.message` arm was unreachable — a trap for whoever writes the next fallback spec, since the obvious reading is that the `log?.` optional call is what's uncovered. Two specs throw codeless errors to cover it, then cli-app joins both matrices in the same commit so CI never observes a failing job. Verified on Node 14 (what these workflows currently run): 83/83, 100% statements/branches/functions/lines, exit 0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude Code PR ReviewPR: #2402 • Head: fd29784 • Reviewers: stack-code-reviewer SummaryAdds Review Table
Findings
Dismissed after verification
Verdict: PASS — test-and-CI-only change, correctly targeted and green on CI; the two Low items are pre-existing and out of scope for this diff. |
Adds
@percy/cli-appto CI. It was the only one of 18 packages missing from both thetest.ymlandwindows.ymlmatrices, so its 81 specs have never run in CI on any platform.Adding it as-is would have turned CI red — the package sits at 98.44% branch coverage against the repo's 100% threshold:
The uncovered branch is not the one it looks like
Both lines contain a
log?.optional call, which is the obvious suspect. It isn't that. The gap iserr.code || err.message, interpolated into the warning atmaestro-inject.js:157and the debug line at:273. Every existing spec throws an error carrying a code (EACCES,EROFS,EEXIST,ENOENT), so theerr.messagearm is unreachable.Worth stating explicitly because it is a trap for the next fallback spec: adding another coded-error case moves no coverage at all.
Two specs throw codeless errors to cover it, and
cli-appjoins both matrices in the same commit so CI never observes a failing job.Verification
Run the way these workflows currently do — Node 14:
Found via, but deliberately separate from, the Node 20 work
Surfaced while auditing package coverage for #2386. It is unrelated to that migration — the gap is version-agnostic and would fail identically on any Node — so it is kept off that branch rather than widening a release-bound PR.
One note for reviewers of #2386: running this same suite on master + Node 20 reports
All files | 0 | 0 | 0 | 0and still exits 0. That is the vacuous-coverage failure mode #2386 fixes, reproduced here incidentally. It is why the verification above was run on Node 14.🤖 Generated with Claude Code