Skip to content

TestAnswer ​

A queued answer consumed by createTestPrompter.

The test prompter leaves malformed non-string values intact for resolver error tests. Text answers use the same whitespace, empty-answer, default, and validation policy as the terminal prompter. Passwords retry invalid answers; ordinary input retains its cancellation fallback (see createTestPrompter). The normal resolution pipeline performs any later type coercion, so tests can supply values in the same shapes real prompts would yield:

  • string for input and select
  • boolean for confirm
  • string[] for multiselect
  • PROMPT_CANCEL to simulate user cancellation

Because the type is intentionally unknown, tests may also inject malformed answers to exercise downstream validation and error reporting.

Signatures ​

ts
type TestAnswer = unknown;

See Also ​

Released under the MIT License.