File tree Expand file tree Collapse file tree 1 file changed +17
-14
lines changed
Expand file tree Collapse file tree 1 file changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -562,20 +562,23 @@ describe("runWizard", () => {
562562 } ;
563563 mockResumeResults = [ { status : "success" } ] ;
564564
565- await runWizard ( makeOptions ( ) ) ;
566-
567- Object . defineProperty ( process . stdout , "columns" , {
568- value : origColumns ,
569- configurable : true ,
570- } ) ;
571-
572- // 40 columns - 4 reserved = 36 max, truncated with "…"
573- const call = spinnerMock . message . mock . calls . find ( ( c : string [ ] ) =>
574- c [ 0 ] ?. includes ( "npm install" )
575- ) ;
576- expect ( call ) . toBeDefined ( ) ;
577- expect ( call [ 0 ] . length ) . toBeLessThanOrEqual ( 36 ) ;
578- expect ( call [ 0 ] . endsWith ( "…" ) ) . toBe ( true ) ;
565+ try {
566+ await runWizard ( makeOptions ( ) ) ;
567+
568+ // 40 columns - 4 reserved = 36 max, truncated with "…"
569+ const call = spinnerMock . message . mock . calls . find ( ( c : string [ ] ) =>
570+ c [ 0 ] ?. includes ( "npm install" )
571+ ) as string [ ] | undefined ;
572+ expect ( call ) . toBeDefined ( ) ;
573+ const msg = call ?. [ 0 ] ?? "" ;
574+ expect ( msg . length ) . toBeLessThanOrEqual ( 36 ) ;
575+ expect ( msg . endsWith ( "…" ) ) . toBe ( true ) ;
576+ } finally {
577+ Object . defineProperty ( process . stdout , "columns" , {
578+ value : origColumns ,
579+ configurable : true ,
580+ } ) ;
581+ }
579582 } ) ;
580583
581584 test ( "dispatches interactive payload to handleInteractive" , async ( ) => {
You can’t perform that action at this time.
0 commit comments