@@ -96,7 +96,7 @@ describe('ClearcutSender', () => {
9696 sender . enqueueEvent ( {
9797 tool_invocation : { tool_name : 'test' , success : true , latency_ms : 100 } ,
9898 } ) ;
99-
99+
100100 await clock . tickAsync ( FLUSH_INTERVAL_MS ) ;
101101 sender . stopForTesting ( ) ;
102102
@@ -237,10 +237,12 @@ describe('ClearcutSender', () => {
237237 tool_invocation : { tool_name : 'initial' , success : true , latency_ms : 100 } ,
238238 } ) ;
239239 let resolveRequest : ( value : Response ) => void ;
240-
241- fetchStub . onFirstCall ( ) . returns ( new Promise < Response > ( resolve => {
242- resolveRequest = resolve ;
243- } ) ) ;
240+
241+ fetchStub . onFirstCall ( ) . returns (
242+ new Promise < Response > ( resolve => {
243+ resolveRequest = resolve ;
244+ } ) ,
245+ ) ;
244246
245247 clock . tick ( FLUSH_INTERVAL_MS ) ;
246248
@@ -270,21 +272,27 @@ describe('ClearcutSender', () => {
270272 forceFlushIntervalMs : FLUSH_INTERVAL_MS ,
271273 } ) ;
272274 sender . enqueueEvent ( {
273- tool_invocation : { tool_name : 'test-event' , success : true , latency_ms : 100 } ,
275+ tool_invocation : {
276+ tool_name : 'test-event' ,
277+ success : true ,
278+ latency_ms : 100 ,
279+ } ,
274280 } ) ;
275-
281+
276282 let resolveFirstRequest : ( value : Response ) => void ;
277- fetchStub . onFirstCall ( ) . returns ( new Promise < Response > ( resolve => {
278- resolveFirstRequest = resolve ;
279- } ) ) ;
283+ fetchStub . onFirstCall ( ) . returns (
284+ new Promise < Response > ( resolve => {
285+ resolveFirstRequest = resolve ;
286+ } ) ,
287+ ) ;
280288
281289 clock . tick ( FLUSH_INTERVAL_MS ) ;
282290
283291 const shutdownPromise = sender . sendShutdownEvent ( ) ;
284292
285293 resolveFirstRequest ! ( new Response ( JSON . stringify ( { } ) , { status : 200 } ) ) ;
286294 await shutdownPromise ;
287-
295+
288296 assert . strictEqual ( fetchStub . callCount , 2 ) ;
289297 const firstBody = JSON . parse ( fetchStub . args [ 0 ] [ 1 ] . body ) as LogRequest ;
290298 const secondBody = JSON . parse ( fetchStub . args [ 1 ] [ 1 ] . body ) as LogRequest ;
@@ -308,7 +316,7 @@ describe('ClearcutSender', () => {
308316 secondEvents [ 0 ] . server_shutdown ,
309317 'Shutdown request should contain server_shutdown' ,
310318 ) ;
311-
319+
312320 sender . stopForTesting ( ) ;
313321 } ) ;
314322
@@ -327,11 +335,15 @@ describe('ClearcutSender', () => {
327335 const firstCallBody = JSON . parse (
328336 fetchStub . firstCall . args [ 1 ] . body ,
329337 ) as LogRequest ;
330- const firstEvent = JSON . parse ( firstCallBody . log_event [ 0 ] . source_extension_json ) ;
338+ const firstEvent = JSON . parse (
339+ firstCallBody . log_event [ 0 ] . source_extension_json ,
340+ ) ;
331341 const firstSessionId = firstEvent . session_id ;
332342
333343 const SESSION_ROTATION_INTERVAL_MS = 24 * 60 * 60 * 1000 ;
334- await clock . tickAsync ( SESSION_ROTATION_INTERVAL_MS - FLUSH_INTERVAL_MS + 1000 ) ;
344+ await clock . tickAsync (
345+ SESSION_ROTATION_INTERVAL_MS - FLUSH_INTERVAL_MS + 1000 ,
346+ ) ;
335347
336348 sender . enqueueEvent ( {
337349 tool_invocation : { tool_name : 'test2' , success : true , latency_ms : 10 } ,
@@ -341,7 +353,9 @@ describe('ClearcutSender', () => {
341353 const secondCallBody = JSON . parse (
342354 fetchStub . secondCall . args [ 1 ] . body ,
343355 ) as LogRequest ;
344- const secondEvent = JSON . parse ( secondCallBody . log_event [ 0 ] . source_extension_json ) ;
356+ const secondEvent = JSON . parse (
357+ secondCallBody . log_event [ 0 ] . source_extension_json ,
358+ ) ;
345359 const secondSessionId = secondEvent . session_id ;
346360
347361 assert . notStrictEqual ( firstSessionId , secondSessionId ) ;
@@ -356,9 +370,14 @@ describe('ClearcutSender', () => {
356370 forceFlushIntervalMs : FLUSH_INTERVAL_MS ,
357371 } ) ;
358372
359- fetchStub . resolves ( new Response ( JSON . stringify ( {
360- next_request_wait_millis : 45000 ,
361- } ) , { status : 200 } ) ) ;
373+ fetchStub . resolves (
374+ new Response (
375+ JSON . stringify ( {
376+ next_request_wait_millis : 45000 ,
377+ } ) ,
378+ { status : 200 } ,
379+ ) ,
380+ ) ;
362381
363382 sender . enqueueEvent ( { } ) ;
364383 await clock . tickAsync ( FLUSH_INTERVAL_MS ) ;
@@ -368,7 +387,11 @@ describe('ClearcutSender', () => {
368387 sender . enqueueEvent ( { } ) ;
369388
370389 await clock . tickAsync ( 44000 ) ;
371- assert . strictEqual ( fetchStub . callCount , 0 , 'Should not flush before wait time' ) ;
390+ assert . strictEqual (
391+ fetchStub . callCount ,
392+ 0 ,
393+ 'Should not flush before wait time' ,
394+ ) ;
372395
373396 await clock . tickAsync ( 1000 ) ;
374397 assert . strictEqual ( fetchStub . callCount , 1 , 'Should flush after wait time' ) ;
@@ -398,7 +421,11 @@ describe('ClearcutSender', () => {
398421 await clock . tickAsync ( REQUEST_TIMEOUT_MS ) ;
399422
400423 assert . ok ( fetchSignal , 'Fetch should have been called with a signal' ) ;
401- assert . strictEqual ( fetchSignal . aborted , true , 'Signal should be aborted after timeout' ) ;
424+ assert . strictEqual (
425+ fetchSignal . aborted ,
426+ true ,
427+ 'Signal should be aborted after timeout' ,
428+ ) ;
402429
403430 sender . stopForTesting ( ) ;
404431 } ) ;
@@ -409,9 +436,11 @@ describe('ClearcutSender', () => {
409436 osType : OsType . OS_TYPE_MACOS ,
410437 forceFlushIntervalMs : FLUSH_INTERVAL_MS ,
411438 } ) ;
412- fetchStub . returns ( new Promise ( ( ) => {
413- // Hangs forever
414- } ) ) ;
439+ fetchStub . returns (
440+ new Promise ( ( ) => {
441+ // Hangs forever
442+ } ) ,
443+ ) ;
415444
416445 const shutdownPromise = sender . sendShutdownEvent ( ) ;
417446
0 commit comments