-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Why
lwt has no tests. As features grow (aliases, -yolo, agent integration), it's easy to break argument parsing, worktree path logic, or status detection silently.
Proposal
Use bats-core with --shell /bin/zsh so tests run in the same shell lwt uses.
What to test
- Utility functions: editor resolution, random branch names, .env copying, lockfile detection, merge/dirty/unpushed status detection
- Argument parsing: every command's flags, options, error cases
- Worktree operations: correct paths (
../.worktrees/<project>/<branch>/), branch creation, auto-naming - Dispatch: routing, aliases (a/s/ls/rm/rn), help output
- Doctor: dependency reporting
What to skip
- fzf interaction, editor/agent launching, real network calls — all mocked
Isolation
Each test creates a disposable git repo in /tmp. No side effects on real repos.
Structure
test/
test_helper/
bats-support/ # submodule
bats-assert/ # submodule
common.bash # shared setup/teardown + mocks
utils.bats # start here — pure functions
dispatch.bats
add.bats
list.bats
remove.bats
clean.bats
rename.bats
doctor.bats
Run
brew install bats-core
bats --shell /bin/zsh test/Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels