test(cli): cover entrypoint behavior and exit codes#69
Open
scorpevans wants to merge 6 commits intomainfrom
Open
test(cli): cover entrypoint behavior and exit codes#69scorpevans wants to merge 6 commits intomainfrom
scorpevans wants to merge 6 commits intomainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Narrows the error boundary to parseYaml only so that process.exit calls for help/no-args remain outside any try-catch, keeping exit codes correct when process.exit is intercepted in tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Author
|
Reviewed. Checked: (1) all 6 commits target distinct gaps; (2) source change is minimal — |
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
main()is now exported and wrapsparseYamlin a narrow try-catch so ENOENT and YAML parse errors are caught, printed, and exit 1 — without swallowing theprocess.exitcalls for help/no-args (which must remain outside the catch boundary to keep exit codes correct whenprocess.exitis intercepted in tests)printUsageflag tests:--out,--overwrite,--no-overwriteflags are listed in usage output--help/-h: exits 0, prints usage[rule] entryKey: messagevalidation errors to stderrprocess.exitis never called (implicit exit 0),created/updatedlines appear in stdoutEach scenario is a separate commit. Exit codes are verified explicitly in every
main()test via a capturedexitCodesarray (theprocess.exitmock pushes the code and throws to stop execution).Test plan
pnpm --filter odetovibe test— all 158 tests pass🤖 Generated with Claude Code