File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ test('prompts for the framework if none supplied', () => {
4444 expect ( stdout ) . toContain ( 'Select a framework:' )
4545} )
4646
47+ test ( 'prompts for the framework on not supplying a value for --template' , ( ) => {
48+ const { stdout } = run ( [ projectName , '--template' ] )
49+ expect ( stdout ) . toContain ( 'Select a framework:' )
50+ } )
51+
4752test ( 'prompts for the framework on supplying an invalid template' , ( ) => {
4853 const { stdout } = run ( [ projectName , '--template' , 'unknown' ] )
4954 expect ( stdout ) . toContain (
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ async function init() {
175175 type : template && TEMPLATES . includes ( template ) ? null : 'select' ,
176176 name : 'framework' ,
177177 message :
178- template && ! TEMPLATES . includes ( template )
178+ typeof template === 'string' && ! TEMPLATES . includes ( template )
179179 ? `"${ template } " isn't a valid template. Please choose from below: `
180180 : 'Select a framework:' ,
181181 initial : 0 ,
You can’t perform that action at this time.
0 commit comments