terkelg/prompts

Convenient way to select initial values in tests

オープン

#44 opened on 2018/03/04

 (3 件のコメント) (1 件のリアクション) (0 人の担当者)JavaScript (320 件のフォーク)batch import
help wanted

Repository metrics

Stars
 (9,310 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

inject is great when, within a test, you want to simulate the user supplying an answer, but what about when you want to simulate them choosing the initial or default value? I can submit a PR if we can decide on how to implement this. My proposal is that if an injected answer is undefined prompts would just use the initial value. e.g.:

prompts.inject({ a: undefined })

コントリビューターガイド