test: raise unit coverage to ~99.9% and enforce coverage thresholds#65
Merged
Conversation
Add unit tests across the CLI (commands, core, generators, prompts, utils, and the entry dispatcher), bringing line coverage from 23% to 99.9%. Tests are co-located *.test.ts, follow the repo's dependency-injection style, and mock external boundaries (@clack/prompts, fs, child_process, network, keyring) without changing any source. Add Vitest coverage thresholds (lines/statements 99, functions 99, branches 95) as a regression floor. The remaining uncovered lines are unreachable branches (a private multiline-env helper in the docker generator).
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
Adds a comprehensive unit test suite across the CLI and sets a Vitest coverage floor so coverage cannot silently regress.
*.test.ts, follow the repo's dependency-injection style, and mock external boundaries (@clack/prompts, fs, child_process, network, keyring) without changing any source.Verification
npm run buildpasses.npm run coveragepasses: 46 test files / 548 tests (1 gated e2e file skipped). All files at 99.88% lines, 96.92% branches, above the configured floors.Notes
This branch is the test-expansion work rebased cleanly onto current
main. The originaltest/coverage-pushbranch predated amainhistory rewrite, so only the single test commit was lifted onto the current base to keep the diff focused.