@@ -79,7 +79,7 @@ async function main() {
79
79
choices : [ 'All' , ...choices ] ,
80
80
multiple : true ,
81
81
suggest : ( input , choices ) => {
82
- return matchSorter ( choices , input )
82
+ return matchSorter ( choices , input , { keys : [ 'name' ] } )
83
83
} ,
84
84
} )
85
85
@@ -88,6 +88,18 @@ async function main() {
88
88
: response . appDisplayNames . map ( appDisplayName =>
89
89
displayNameMap . get ( appDisplayName ) ,
90
90
)
91
+
92
+ // Update this block to use process.argv
93
+ const appPattern =
94
+ selectedApps . length === allApps . length
95
+ ? '*'
96
+ : selectedApps
97
+ . map ( app => `${ app . exerciseNumber } .${ app . stepNumber } .${ app . type } ` )
98
+ . join ( ',' )
99
+ const additionalArgsString =
100
+ additionalArgs . length > 0 ? ` -- ${ additionalArgs . join ( ' ' ) } ` : ''
101
+ console . log ( `\nℹ️ To skip the prompt next time, use this command:` )
102
+ console . log ( `npm test -- ${ appPattern } ${ additionalArgsString } \n` )
91
103
}
92
104
93
105
if ( selectedApps . length === 0 ) {
@@ -124,10 +136,11 @@ async function main() {
124
136
console . log ( 'Outputting results of running tests:' )
125
137
for ( const [ app , output ] of runningProcesses . entries ( ) ) {
126
138
if ( output . hasOutput ( ) ) {
127
- console . log ( `\nPartial results for ${ app . relativePath } :` )
139
+ console . log ( `\nPartial results for ${ app . relativePath } :\n\n ` )
128
140
output . replay ( )
141
+ console . log ( '\n\n' )
129
142
} else {
130
- console . log ( `ℹ️ No output captured for ${ app . relativePath } ` )
143
+ console . log ( `ℹ️ No output captured for ${ app . relativePath } ` )
131
144
}
132
145
}
133
146
// Allow some time for output to be written before exiting
@@ -166,19 +179,21 @@ async function main() {
166
179
167
180
if ( exitCode !== 0 ) {
168
181
hasFailures = true
169
- console . error ( `\n❌ Tests failed for ${ app . relativePath } :` )
182
+ console . error ( `\n❌ Tests failed for ${ app . relativePath } :\n\n ` )
170
183
output . replay ( )
184
+ console . log ( '\n\n' )
171
185
} else {
172
186
console . log ( `✅ Finished tests for ${ app . relativePath } ` )
173
187
}
174
188
} catch ( error ) {
175
189
runningProcesses . delete ( app )
176
190
hasFailures = true
177
191
console . error (
178
- `\n❌ An error occurred while running tests for ${ app . relativePath } :` ,
192
+ `\n❌ An error occurred while running tests for ${ app . relativePath } :\n\n ` ,
179
193
)
180
194
console . error ( error . message )
181
195
output . replay ( )
196
+ console . log ( '\n\n' )
182
197
}
183
198
} ) ,
184
199
)
0 commit comments