File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed
Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ function resolveOutputFormat(): "tui" | "json" {
1212 try {
1313 return getOutputFormat ( cli ) ;
1414 } catch {
15- // Fallback for unexpected failures before Commander parses options .
15+ // If option parsing fails, still show the underlying CLI error without double-logging here .
1616 return "tui" ;
1717 }
1818}
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ describe("handleCliError", () => {
99 beforeEach ( ( ) => {
1010 originalIsTTY = process . stderr . isTTY ;
1111 exitSpy = spyOn ( process , "exit" ) . mockImplementation ( ( code ?: number ) => {
12+ // Bubble a sentinel error so tests can assert the exit while preventing the process from terminating.
1213 throw new Error ( "process.exit" ) ;
1314 } ) ;
1415 errorSpy = spyOn ( console , "error" ) . mockImplementation ( ( ) => { } ) ;
You can’t perform that action at this time.
0 commit comments