Skip to content

Commit

Permalink
fix(create-app): improve prompt message (#3769)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 authored Jun 12, 2021
1 parent d3e8bef commit 9703bcd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/create-app/__tests__/cli.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ test('prompts for the framework if none supplied', () => {
expect(stdout).toContain('Select a framework:')
})

test('prompts for the framework on not supplying a value for --template', () => {
const { stdout } = run([projectName, '--template'])
expect(stdout).toContain('Select a framework:')
})

test('prompts for the framework on supplying an invalid template', () => {
const { stdout } = run([projectName, '--template', 'unknown'])
expect(stdout).toContain(
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ async function init() {
type: template && TEMPLATES.includes(template) ? null : 'select',
name: 'framework',
message:
template && !TEMPLATES.includes(template)
typeof template === 'string' && !TEMPLATES.includes(template)
? `"${template}" isn't a valid template. Please choose from below: `
: 'Select a framework:',
initial: 0,
Expand Down

0 comments on commit 9703bcd

Please sign in to comment.