File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ process . stdin . setEncoding ( 'utf8' ) ;
2+
3+ let buffer = '' ;
4+
5+ process . stdin . on ( 'data' , ( chunk ) => {
6+ buffer += chunk ;
7+ const newlineIndex = buffer . search ( / [ \r \n ] / u) ;
8+ if ( newlineIndex === - 1 ) {
9+ return ;
10+ }
11+
12+ const line = buffer . slice ( 0 , newlineIndex ) ;
13+ process . stdout . write ( `${ line } \n` ) ;
14+ process . exit ( 0 ) ;
15+ } ) ;
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ const BACKEND_WS_PATH = '/ws';
8383const WS_RECONNECT_DELAY_MS = 800 ;
8484const WORKSPACE_PATH = process . cwd ( ) ;
8585const WORKSPACE_PROBE_FILE = path . join ( WORKSPACE_PATH , 'package.json' ) ;
86+ const AGENT_STDIN_ECHO_SCRIPT = 'tests/e2e/fixtures/agent-stdin-echo.mjs' ;
8687const execFileAsync = promisify ( execFile ) ;
8788
8889const incrementCounts = ( counts : PollCounts ) => ( {
@@ -648,15 +649,13 @@ function buildTerminalProbeInput(target: WorkspaceHandle['target']) {
648649}
649650
650651function buildAgentProbeCommand ( target : WorkspaceHandle [ 'target' ] ) {
651- return isWindowsNativeTarget ( target )
652- ? 'cmd /Q /D /K'
653- : 'cat' ;
652+ void target ;
653+ return `node ${ AGENT_STDIN_ECHO_SCRIPT } ` ;
654654}
655655
656656function buildAgentProbeInput ( target : WorkspaceHandle [ 'target' ] ) {
657- return isWindowsNativeTarget ( target )
658- ? 'echo transport-agent'
659- : 'transport-agent' ;
657+ void target ;
658+ return 'transport-agent' ;
660659}
661660
662661function countTrackedSockets ( tracker : TransportTrackerSnapshot , fragment : string ) {
You can’t perform that action at this time.
0 commit comments