Skip to content

Commit

Permalink
Make prompt more descriptive
Browse files Browse the repository at this point in the history
When composed it's looked out of context, it wasn't obvious what it was
referring to.
  • Loading branch information
silvenon committed Jun 9, 2019
1 parent 46c8498 commit 43cdf16
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = class extends Generator {
super(args, opts);

this.option('ui', {
desc: 'Choose your style of test DSL for Mocha (bdd, tdd)',
desc: `Choose the interface style (bdd, tdd)`,
type: String
});

Expand All @@ -22,14 +22,23 @@ module.exports = class extends Generator {
const prompts = [{
type: 'list',
name: 'ui',
message: 'Choose your style of DSL',
choices: ['BDD', 'TDD'],
message: `Choose the interface style for Mocha`,
choices: [
{
name: 'BDD (Behavior-Driven Development)',
value: 'bdd'
},
{
name: 'TDD (Test-Driven Development)',
value: 'tdd'
}
],
default: 'BDD',
when: !this.options.ui
}];

this.prompt(prompts).then(answers => {
this.options.ui = (this.options.ui || answers.ui).toLowerCase();
this.options.ui = this.options.ui || answers.ui;
done();
});
}
Expand Down

0 comments on commit 43cdf16

Please sign in to comment.