diff --git a/src/prompt-test.js b/src/prompt-test.js index dab7cfea..04998e07 100644 --- a/src/prompt-test.js +++ b/src/prompt-test.js @@ -27,8 +27,8 @@ suite('prompt', () => { }); test('that decisions are directly included in answers, with those questions excluded from prompts', async () => { - const decisions = any.simpleObject(); - const questionNames = Object.keys(decisions); + const questionNames = any.listOf(any.word); + const decisions = any.objectWithKeys(questionNames, {factory: any.boolean}); inquirer.prompt.withArgs(questions).resolves(answers); assert.deepEqual( diff --git a/src/prompt.js b/src/prompt.js index edb876b3..cdbb7cab 100644 --- a/src/prompt.js +++ b/src/prompt.js @@ -2,7 +2,7 @@ import {prompt} from 'inquirer'; export default async function (questions, decisions = {}) { const {filteredQuestions, providedAnswers} = questions.reduce((acc, question) => { - if (decisions[question.name]) { + if (undefined !== decisions[question.name]) { return { filteredQuestions: acc.filteredQuestions, providedAnswers: {...acc.providedAnswers, [question.name]: decisions[question.name]}