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

贡献者指南