@@ -24,7 +24,6 @@ type RunResult = {
2424
2525async function runCliCapture (
2626 argv : string [ ] ,
27- options : { forceStdinTty ?: boolean } = { } ,
2827) : Promise < RunResult > {
2928 let stdout = '' ;
3029 let stderr = '' ;
@@ -34,7 +33,6 @@ async function runCliCapture(
3433 const originalExit = process . exit ;
3534 const originalStdoutWrite = process . stdout . write . bind ( process . stdout ) ;
3635 const originalStderrWrite = process . stderr . write . bind ( process . stderr ) ;
37- const stdinDescriptor = Object . getOwnPropertyDescriptor ( process . stdin , 'isTTY' ) ;
3836
3937 ( process as any ) . exit = ( ( nextCode ?: number ) => {
4038 throw new ExitSignal ( nextCode ?? 0 ) ;
@@ -47,12 +45,6 @@ async function runCliCapture(
4745 stderr += String ( chunk ) ;
4846 return true ;
4947 } ) as typeof process . stderr . write ;
50- if ( options . forceStdinTty !== undefined ) {
51- Object . defineProperty ( process . stdin , 'isTTY' , {
52- configurable : true ,
53- value : options . forceStdinTty ,
54- } ) ;
55- }
5648
5749 const sendToDaemon = async ( req : Omit < DaemonRequest , 'token' > ) : Promise < DaemonResponse > => {
5850 calls . push ( req ) ;
@@ -68,13 +60,6 @@ async function runCliCapture(
6860 process . exit = originalExit ;
6961 process . stdout . write = originalStdoutWrite ;
7062 process . stderr . write = originalStderrWrite ;
71- if ( options . forceStdinTty !== undefined ) {
72- if ( stdinDescriptor ) {
73- Object . defineProperty ( process . stdin , 'isTTY' , stdinDescriptor ) ;
74- } else {
75- delete ( process . stdin as any ) . isTTY ;
76- }
77- }
7863 }
7964
8065 return { code, stdout, stderr, calls } ;
@@ -113,10 +98,3 @@ test('batch --steps-file parses file payload', async () => {
11398 assert . equal ( req . command , 'batch' ) ;
11499 assert . equal ( ( req . flags ?. batchSteps ?? [ ] ) [ 0 ] ?. command , 'wait' ) ;
115100} ) ;
116-
117- test ( 'batch --steps-stdin fails fast when stdin is TTY' , async ( ) => {
118- const result = await runCliCapture ( [ 'batch' , '--steps-stdin' ] , { forceStdinTty : true } ) ;
119- assert . equal ( result . code , 1 ) ;
120- assert . equal ( result . calls . length , 0 ) ;
121- assert . match ( result . stderr , / - - s t e p s - s t d i n r e q u i r e s p i p e d J S O N i n p u t / ) ;
122- } ) ;
0 commit comments