test: add command-level tests for create, sync and config - #31
Merged
Conversation
epodivilov
marked this pull request as ready for review
July 21, 2026 22:04
epodivilov
force-pushed
the
test/command-level-tests
branch
from
July 21, 2026 22:08
d4149e4 to
7b988dd
Compare
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.
Adds command-level tests for the three CLI commands that had none. Tests only — no production code changed. They follow the existing
update.test.ts/remove.test.tspattern: drive the command through fake ports and assert on what it renders viaUiPortplus the resulting fake git/fs/shell state.Covered
create (19 tests)
--base, base prompt when the flag is absent, existing local branch (no base resolution), remote-only branch (checked out from the remote).--dry-run: every preview line, and no git/fs/shell side effects.sync (16 tests)
--dry-run: "would" verbs, no writes, hooks skipped.--forcehint, overwrite with--force, real file where a symlink belongs.config show (8 tests)
--json: payload shape on stdout,undefinedserialized as null, interactive UI bypassed.Not covered
resolve-params.resolve-worktree-planand are exercised at the use-case level.configcommand without a subcommand (citty help routing).config show --json, thecatcharound the JSON branch is only reachable because the test stubsprocess.exitinstead of terminating, so only the first stderr line is asserted.