terkelg/prompts

Convenient way to select initial values in tests

Aperta

#44 aperta il 4 mar 2018

 (3 commenti) (1 reazione) (0 assegnatari)JavaScript (320 fork)batch import
help wanted

Metriche repository

Star
 (9308 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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 })

Guida contributor