44 * dependencies (no real network).
55 */
66
7- import { describe , it , expect , vi , beforeEach } from 'vitest' ;
7+ import { describe , it , expect , vi } from 'vitest' ;
88import {
99 HandOffManager ,
1010 computeTakeoverJitterMs ,
1111 type HandOffDependencies ,
1212 type HandOffLogEntry ,
1313} from './hand-off.js' ;
1414import { HostUnreachableError } from '../types.js' ;
15- import { createHealthHandler , type HealthInfo } from './health-endpoint.js' ;
15+ import { createHealthHandler } from './health-endpoint.js' ;
1616
1717// ---------------------------------------------------------------------------
1818// Helpers
@@ -257,7 +257,7 @@ describe('HandOffManager', () => {
257257 await manager . onHostDisconnectedAsync ( ) ;
258258
259259 // Should have logs: host-transfer-notice, graceful-disconnect, bind-success
260- const reasons = logger . mock . calls . map ( ( c : [ HandOffLogEntry ] ) => c [ 0 ] . reason ) ;
260+ const reasons = logger . mock . calls . map ( ( c : any [ ] ) => c [ 0 ] . reason ) ;
261261 expect ( reasons ) . toContain ( 'host-transfer-notice' ) ;
262262 expect ( reasons ) . toContain ( 'graceful-disconnect' ) ;
263263 expect ( reasons ) . toContain ( 'bind-success' ) ;
@@ -275,7 +275,7 @@ describe('HandOffManager', () => {
275275 await manager . onHostDisconnectedAsync ( ) ;
276276 randomSpy . mockRestore ( ) ;
277277
278- const reasons = logger . mock . calls . map ( ( c : [ HandOffLogEntry ] ) => c [ 0 ] . reason ) ;
278+ const reasons = logger . mock . calls . map ( ( c : any [ ] ) => c [ 0 ] . reason ) ;
279279 expect ( reasons ) . toContain ( 'crash-jitter' ) ;
280280 expect ( reasons ) . toContain ( 'crash-detected' ) ;
281281 } ) ;
@@ -297,7 +297,7 @@ describe('HandOffManager', () => {
297297 await manager . onHostDisconnectedAsync ( ) ;
298298
299299 const retryEntries = logger . mock . calls
300- . map ( ( c : [ HandOffLogEntry ] ) => c [ 0 ] )
300+ . map ( ( c : any [ ] ) => c [ 0 ] )
301301 . filter ( ( e : HandOffLogEntry ) => e . reason === 'retry' ) ;
302302 expect ( retryEntries . length ) . toBe ( 2 ) ;
303303 expect ( retryEntries [ 0 ] . data ?. attempt ) . toBe ( 0 ) ;
@@ -316,7 +316,7 @@ describe('HandOffManager', () => {
316316 manager . onHostTransferNotice ( ) ;
317317 await expect ( manager . onHostDisconnectedAsync ( ) ) . rejects . toThrow ( HostUnreachableError ) ;
318318
319- const reasons = logger . mock . calls . map ( ( c : [ HandOffLogEntry ] ) => c [ 0 ] . reason ) ;
319+ const reasons = logger . mock . calls . map ( ( c : any [ ] ) => c [ 0 ] . reason ) ;
320320 expect ( reasons ) . toContain ( 'retries-exhausted' ) ;
321321 } ) ;
322322
@@ -371,12 +371,10 @@ describe('Health endpoint observability fields', () => {
371371
372372 // Simulate an HTTP response object
373373 let statusCode = 0 ;
374- let headers : Record < string , string > = { } ;
375374 let body = '' ;
376375 const res = {
377- writeHead ( code : number , hdrs : Record < string , string | number > ) {
376+ writeHead ( code : number , _hdrs : Record < string , string | number > ) {
378377 statusCode = code ;
379- headers = hdrs as Record < string , string > ;
380378 } ,
381379 end ( data : string ) {
382380 body = data ;
0 commit comments