You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: add unit tests for alias, alias resolution, and msg commands (#28)
## Summary
- Add 29 new unit tests covering three features that had zero test
coverage
- All tests run locally without tmux or Docker (part of `make test`)
### Alias command tests (17 tests)
- Empty state listing, argument validation for set/rm
- Name validation: rejects spaces and special chars, accepts hyphens and
underscores
- Full CRUD lifecycle: set, list, overwrite, remove
- Persistence verified directly via yq against `~/.crabcode/config.yaml`
- Unknown subcommand error handling
### Alias resolution tests (2 tests)
- Verifies `crab <alias>` resolves to the target command at runtime
- Single-word and multi-word alias resolution
### Msg command tests (10 tests)
- Help output and no-args behavior
- Status display without active relay
- Text-to-speech toggle (on/off) and state reflection
- Unknown subcommand handling
- Graceful degradation for read/history without relay
## Test plan
- [x] `make test` — all 29 new tests pass
- [x] Pre-existing failures (14) confirmed unchanged via `git stash`
comparison
- [x] Tests clean up after themselves (backup/restore global config,
remove test aliases)
```
Results: 40 passed, 14 failed (54 total)
# Before this PR: 11 passed, 14 failed (25 total)
# Net: +29 passing tests, 0 new failures
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments