yeoman/generator — pull request #711 by bajtos (2014-12-02 09:30:10+00:00)
Title: Fix mockPrompt's handling of falsy answers

Fix `mockPrompt` and `DummyPrompt` to copy Inquirer's behaviour when
dealing with falsy answers.

- The `list` prompt treats all values including `null` and `false`
as a valid response.

- The `input` prompt replaces `undefined` and `null` with the default
value.

- All other prompts are kept unchanged, they replace every falsy
answer with the default value.

---

I have run into this issue while upgrading from yeoman-generator v0.16 to v0.18.

My generator uses a `list` prompt to select a model name from a list of know models, plus there is an extra option `{ name: '(custom)', value: null }` allowing the user to enter arbitrary value in the next prompt.

The code works when invoked via `yo`. The tests are failing because `null` is treated as "use default" now.