New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add useDefaults option to mockPrompt #487
Conversation
You'll have to fix the Travis error about style guide :) |
{ name: 'answser', type: 'input', default: 'bar'}, | ||
{ name: 'respuesta', type: 'input', default: 'baz'} | ||
], function (answers) { | ||
assert.equal(answers.answer, 'foo'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You assert too much in a single test.
Take the mockPrompt
call in a beforeEach
call (add a describe
level -> "when useDefaults: true") and assert that defaults are used, and then in another assert that provided values are taken.
I wonder if we shouldn't just use defaults by default. It'd make sense IMO and wouldn't require an extra option with the related overhead. |
I'd love for this to be the default! Should we keep the option defaulted to |
I'd say just go for it! |
👍 for default |
Let's roll with defaults. |
Done, squashed. |
Add useDefaults option to mockPrompt
Perfect! Thanks |
I wanted to test the default option flow in my generator.
mockPrompt
didn't make this easy. TheuseDefaults
option makes this easy without breaking backwards compatibilty.See tests for expected results.