test(create): no automated coverage of the interactive scaffolder paths
Summary
Every automated test of @vendure/create runs the scaffolder with --ci. test_quickstart_postgres and all three test_package_managers jobs pass --ci, and the unit tests drive getCiConfiguration directly. Nothing exercises the Quick Start or Manual paths, which are the ones a human uses.
Those two paths are where the interactive prompts live: Quick Start prompts twice, Manual prompts twelve times.
What this let through
PR #5338 wrapped configuration generation in a @clack/prompts spinner. Both interactive modes prompt from inside that call, so the spinner was running while the user answered.
spinner().start() sets an 80ms interval writing cursor.move(-999,0) + erase.down(1), and calls core.block(), which enables raw mode, opens a second readline interface on the same TTY, and installs a keypress handler that calls process.exit(0) on Ctrl+C before checkCancel sees the cancel symbol.
Driven under a PTY:
| Ctrl+C exit code | outcome | |
|---|---|---|
| without the spinner | 1 | cancelled cleanly via checkCancel |
| with the spinner | 0 | prompt erased by 15 spinner frames, checkCancel never runs |
The change passed review and a fully green CI. It was caught in a merge-lane session and fixed before merge, but only because someone drove the interactive path by hand.
Suggested fix
A PTY-driven smoke test for Quick Start and Manual: spawn the CLI under a pseudo-terminal, answer the prompts, and assert the generated project. The verification above used script to allocate the PTY, so the mechanism is available without a new dependency.
Covering Ctrl+C is worth doing at the same time, since cancellation is what broke and it fails silently — exit code 0 looks like success.
Source: vendurehq/vendure