@@ -24,6 +24,10 @@ const overwriteBlueprintFiles = require('../../src/overwrite-blueprint-files');
2424
2525const toDefault = require ( '../../src/args' ) . to . default ;
2626
27+ const select = ' ' ;
28+ const down = '\u001b[B' ;
29+ const enter = '\n' ;
30+
2731describe ( function ( ) {
2832 this . timeout ( 30 * 1000 ) ;
2933
@@ -187,7 +191,7 @@ describe(function() {
187191 function stdoutData ( data ) {
188192 let str = data . toString ( ) ;
189193 if ( str . includes ( 'These codemods apply to your project.' ) ) {
190- ps . stdin . write ( ' \n' ) ;
194+ ps . stdin . write ( ` ${ select } ${ enter } ` ) ;
191195 ps . stdout . removeListener ( 'data' , stdoutData ) ;
192196 resolve ( ) ;
193197 }
@@ -298,8 +302,6 @@ describe(function() {
298302 function whichBlueprint ( data ) {
299303 let str = data . toString ( ) ;
300304 if ( str . includes ( 'Blueprint updates have been found.' ) ) {
301- let down = '\u001b[B' ;
302- let enter = '\n' ;
303305 ps . stdin . write ( `${ down } ${ enter } ` ) ;
304306 ps . stdout . removeListener ( 'data' , whichBlueprint ) ;
305307 resolve ( ) ;
@@ -311,8 +313,6 @@ describe(function() {
311313 function whichVersion ( data ) {
312314 let str = data . toString ( ) ;
313315 if ( str . includes ( 'Do you want the latest version?' ) ) {
314- let down = '\u001b[B' ;
315- let enter = '\n' ;
316316 ps . stdin . write ( `${ down } ${ enter } ` ) ;
317317 ps . stdout . removeListener ( 'data' , whichVersion ) ;
318318 resolve ( ) ;
@@ -325,7 +325,6 @@ describe(function() {
325325 let str = data . toString ( ) ;
326326 if ( str . includes ( 'What version?' ) ) {
327327 let range = to ;
328- let enter = '\n' ;
329328 ps . stdin . write ( `${ range } ${ enter } ` ) ;
330329 ps . stdout . removeListener ( 'data' , customVersion ) ;
331330 resolve ( ) ;
@@ -377,8 +376,6 @@ describe(function() {
377376 function whichBlueprint ( data ) {
378377 let str = data . toString ( ) ;
379378 if ( str . includes ( 'Which blueprint would you like to reset?' ) ) {
380- let down = '\u001b[B' ;
381- let enter = '\n' ;
382379 ps . stdin . write ( `${ down } ${ enter } ` ) ;
383380 ps . stdout . removeListener ( 'data' , whichBlueprint ) ;
384381 resolve ( ) ;
0 commit comments