Tried a number of approaches, but landed on these:
A mechanism for recording the outputs of the LLM in a fixture for mocking.
A set of tests (interactive.test.ts) that start the interactive mode and ensure that it prompts the user. Tried to go further with https://github.com/microsoft/node-pty but ran into some snags.
A full end-to-end test of the non-interactive CLI execution option, which internally calls a test command so that was tricky. This one also generates the implementation so it uses the LLM mock fixture.
Purpose
Automated testing the CLI (#2)
Approach
Tried a number of approaches, but landed on these:
interactive.test.ts
) that start the interactive mode and ensure that it prompts the user. Tried to go further with https://github.com/microsoft/node-pty but ran into some snags.Open to feedback/suggestions.