File tree Expand file tree Collapse file tree 2 files changed +16
-18
lines changed
packages/core/test/prompts Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -4,22 +4,20 @@ import color from 'picocolors';
44async function main ( ) {
55 const defaultPath = 'my-project' ;
66
7- const result = await p . text (
8- {
9- message : 'Enter the directory to bootstrap the project' ,
10- placeholder : ` (hit Enter to use '${ defaultPath } ')` ,
11- defaultValue : defaultPath ,
12- validate : ( value ) => {
13- if ( ! value ) {
14- return 'Directory is required' ;
15- }
16- if ( value . includes ( ' ' ) ) {
17- return 'Directory cannot contain spaces' ;
18- }
19- return undefined ;
20- } ,
21- }
22- ) ;
7+ const result = await p . text ( {
8+ message : 'Enter the directory to bootstrap the project' ,
9+ placeholder : ` (hit Enter to use '${ defaultPath } ')` ,
10+ defaultValue : defaultPath ,
11+ validate : ( value ) => {
12+ if ( ! value ) {
13+ return 'Directory is required' ;
14+ }
15+ if ( value . includes ( ' ' ) ) {
16+ return 'Directory cannot contain spaces' ;
17+ }
18+ return undefined ;
19+ } ,
20+ } ) ;
2321
2422 if ( p . isCancel ( result ) ) {
2523 p . cancel ( 'Operation cancelled.' ) ;
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ describe('TextPrompt', () => {
117117 output,
118118 render : ( ) => 'foo' ,
119119 placeholder : ' (hit Enter to use default)' ,
120- defaultValue : 'default-value'
120+ defaultValue : 'default-value' ,
121121 } ) ;
122122 const resultPromise = instance . prompt ( ) ;
123123 input . emit ( 'keypress' , '' , { name : 'return' } ) ;
@@ -130,7 +130,7 @@ describe('TextPrompt', () => {
130130 input,
131131 output,
132132 render : ( ) => 'foo' ,
133- placeholder : ' (hit Enter to use default)'
133+ placeholder : ' (hit Enter to use default)' ,
134134 } ) ;
135135 const resultPromise = instance . prompt ( ) ;
136136 input . emit ( 'keypress' , '' , { name : 'return' } ) ;
You can’t perform that action at this time.
0 commit comments