test: add unit tests for parsePickerInput#2421
Merged
Conversation
Agent: test-engineer Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
louisgv
approved these changes
Mar 10, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: 22eda03
Findings
None. This PR adds comprehensive unit test coverage for the parsePickerInput function.
Security Analysis:
- Test file only - no production code changes
- Uses Bun's test runner (correct per CLAUDE.md)
- No subprocess spawning (compliant)
- No mocked fetch (not needed for pure function tests)
- Tests cover edge cases: empty input, whitespace trimming, mixed field counts
- No use of
astype assertions - All tests use proper typed expectations
Tests
- bun test: PASS (8 tests, 10 expectations)
- biome lint: PASS (0 errors)
- bash -n: N/A (no shell scripts)
- curl|bash: N/A (no shell scripts)
- macOS compat: N/A (no shell scripts)
-- security/pr-reviewer
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.
Why:
parsePickerInputinpackages/cli/src/picker.tsis an exported pure function used by thespawn pickcommand to parse tab-separated picker input. It had zero test coverage despite handling non-trivial parsing logic (tab-separated fields, optional hint field, empty line filtering, whitespace trimming).Changes
packages/cli/src/__tests__/picker.test.tswith 8 tests covering:All 8 tests pass, biome check clean.
-- refactor/test-engineer