-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Add infrastructure for testing interactive CLI features using pseudo-terminal (PTY) simulation.
Context
Currently, interactive prompts (jp_inquire, inquire) require a real TTY and cannot be tested automatically. While we can use dependency injection to test the logic around prompts, true end-to-end testing of the CLI's interactive behavior requires simulating terminal input/output.
Libraries like portable-pty or expectrl can create pseudo-terminals that allow injecting keystrokes and capturing output, enabling tests like:
- Interrupt handling (Ctrl+C menus)
- Tool permission prompts
- Multi-select dialogs
- Editor integration
Alternatives
Dependency injection at the prompt level (implemented separately) covers unit testing of prompt-adjacent logic but doesn't verify the actual terminal rendering or keystroke handling.
Proposed Implementation
- Evaluate
portable-ptyvsexpectrlfor our needs - Create a test harness that spawns
jpcommands in a PTY - Add helper functions for sending keystrokes and matching output
- Write e2e tests for critical interactive flows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request