@@ -137,13 +137,17 @@ describe('Web Server', () => {
137137 parentSessionId : 'test' ,
138138 } )
139139
140+ console . log ( 'Created session:' , session )
141+
140142 // Wait for PTY to start
141143 await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) )
142144
143145 const response = await fetch ( `${ serverUrl } /api/sessions/${ session . id } ` )
146+ console . log ( 'Session response status:' , response . status )
144147 expect ( response . status ) . toBe ( 200 )
145148
146149 const sessionData = await response . json ( )
150+ console . log ( 'Session data:' , sessionData )
147151 expect ( sessionData . id ) . toBe ( session . id )
148152 expect ( sessionData . command ) . toBe ( 'cat' )
149153 expect ( sessionData . args ) . toEqual ( [ ] )
@@ -152,6 +156,7 @@ describe('Web Server', () => {
152156 it ( 'should return 404 for non-existent session' , async ( ) => {
153157 const nonexistentId = `nonexistent-${ Math . random ( ) . toString ( 36 ) . substr ( 2 , 9 ) } `
154158 const response = await fetch ( `${ serverUrl } /api/sessions/${ nonexistentId } ` )
159+ console . log ( 'Non-existent response status:' , response . status )
155160 expect ( response . status ) . toBe ( 404 )
156161 } )
157162
@@ -164,6 +169,8 @@ describe('Web Server', () => {
164169 parentSessionId : 'test' ,
165170 } )
166171
172+ console . log ( 'Input session:' , session )
173+
167174 // Wait for PTY to start
168175 await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) )
169176
@@ -173,6 +180,8 @@ describe('Web Server', () => {
173180 body : JSON . stringify ( { data : 'test input\n' } ) ,
174181 } )
175182
183+ console . log ( 'Input response status:' , response . status )
184+
176185 // Should return success
177186 expect ( response . status ) . toBe ( 200 )
178187 const result = await response . json ( )
@@ -190,13 +199,17 @@ describe('Web Server', () => {
190199 parentSessionId : 'test' ,
191200 } )
192201
202+ console . log ( 'Kill session:' , session )
203+
193204 // Wait for PTY to start
194205 await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) )
195206
196207 const response = await fetch ( `${ serverUrl } /api/sessions/${ session . id } /kill` , {
197208 method : 'POST' ,
198209 } )
199210
211+ console . log ( 'Kill response status:' , response . status )
212+
200213 expect ( response . status ) . toBe ( 200 )
201214 const result = await response . json ( )
202215 expect ( result . success ) . toBe ( true )
@@ -211,10 +224,13 @@ describe('Web Server', () => {
211224 parentSessionId : 'test-output' ,
212225 } )
213226
227+ console . log ( 'Output session:' , session )
228+
214229 // Wait a bit for output to be captured
215230 await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) )
216231
217232 const response = await fetch ( `${ serverUrl } /api/sessions/${ session . id } /buffer/raw` )
233+ console . log ( 'Buffer response status:' , response . status )
218234 expect ( response . status ) . toBe ( 200 )
219235
220236 const bufferData = await response . json ( )
0 commit comments