test: lift coverage on jvm-orphan-reaper (36->97%) and minimal-dap (85->92%)#71
Merged
Merged
Conversation
jvm-orphan-reaper.ts: 36% -> 97% lines. Expose parseArgs, listLinux, listDarwin, listWindows, defaultKill as @internal exports so platform-specific code can be unit-tested on any host. Add 31 tests covering pure parsing, process.kill paths, and all three platform listers via vi.mock of node:fs/promises and node:child_process. minimal-dap.ts: 85% -> 92% lines. Add 10 tests for normalizeAdapterId branches, the non-stackTrace child-wait loop, child fallback (graceful, fall-through, rethrow), configurationDone deferral edge cases, and trace-file error swallowing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/utils/jvm-orphan-reaper.ts: 36% → 97% line coverage. ExposeparseArgs,listLinux,listDarwin,listWindows,defaultKillas@internalnamed exports so platform-specific helpers can be unit-tested on any host. Matches the file's existing test-seam pattern (lister/isAlive/killerare already injectable viaReapOptions). Add 31 tests covering pure parsing,process.killpaths, and all three platform listers viavi.mockofnode:fs/promises+node:child_process.src/proxy/minimal-dap.ts: 85% → 92% line coverage. Add 10 tests fornormalizeAdapterIdbranches, the non-stackTrace child-wait loop, child fallback (graceful completion, fall-through, rethrow),configurationDonedeferral edge cases, and trace-file error swallowing.No runtime behavior changes; only
@internalexportkeywords added to previously-private helpers.Coverage delta
src/utils/jvm-orphan-reaper.tssrc/proxy/minimal-dap.tsThe reaper's remaining 3 missing lines are deep inside platform-specific error sub-branches that aren't worth contortion-testing. Minimal-dap's remaining 24 are inside deep child-session timing branches that would need integration-style fixtures rather than unit tests.
Test plan
npm run lint— cleannpx tsc --noEmit— cleannpm run test:unit— 1758 / 1758 pass (+41 net new tests vs. baseline)npm run test:coverage:summary— overall coverage 87.72% statements / 88.2% linesnpm run check:personal-paths— clean (pre-commit hook passed)tests/unit/utils/jvm-orphan-reaper.test.ts(8 orchestration tests) still passes against the modified source🤖 Generated with Claude Code