terkelg/prompts

Convenient way to select initial values in tests

開放

#44 建立於 2018年3月4日

 (3 則留言) (1 個反應) (0 位負責人)JavaScript (319 個分叉)batch import
help wanted

倉庫指標

星標
 (9,311 顆星)
PR 合併指標
 (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 })

貢獻者指南