@@ -187,14 +187,21 @@ export class DataManagerController implements ReactiveController {
187187 : ( [ data ] as Record < string , SuiteStatsFragment > [ ] )
188188
189189 for ( const chunk of payloads ) {
190- if ( ! chunk ) continue
190+ if ( ! chunk ) {
191+ continue
192+ }
191193
192194 for ( const suite of Object . values ( chunk ) ) {
193- if ( ! suite ?. start ) continue
195+ if ( ! suite ?. start ) {
196+ continue
197+ }
194198
195- const suiteStartTime = suite . start instanceof Date
196- ? suite . start . getTime ( )
197- : ( typeof suite . start === 'number' ? suite . start : 0 )
199+ const suiteStartTime =
200+ suite . start instanceof Date
201+ ? suite . start . getTime ( )
202+ : typeof suite . start === 'number'
203+ ? suite . start
204+ : 0
198205
199206 // New run detected if we see a newer start timestamp
200207 if ( suiteStartTime > this . #lastSeenRunTimestamp) {
@@ -264,46 +271,44 @@ export class DataManagerController implements ReactiveController {
264271
265272 const suiteMap = new Map < string , SuiteStatsFragment > ( )
266273
267- console . log ( '[DataManager] Suites update - existing suites:' , this . suitesContextProvider . value ?. length || 0 )
268-
269274 // Populate with existing suites (keeps test list visible)
270275 ; ( this . suitesContextProvider . value || [ ] ) . forEach ( ( chunk ) => {
271276 Object . entries ( chunk as Record < string , SuiteStatsFragment > ) . forEach (
272277 ( [ uid , suite ] ) => {
273278 if ( suite ?. uid ) {
274279 suiteMap . set ( uid , suite )
275- console . log ( '[DataManager] Added existing suite to map:' , uid , suite . title )
276280 }
277281 }
278282 )
279283 } )
280284
281- console . log ( '[DataManager] Incoming payloads:' , payloads . length )
282-
283285 // Process incoming payloads
284286 payloads . forEach ( ( chunk ) => {
285- if ( ! chunk ) return
287+ if ( ! chunk ) {
288+ return
289+ }
286290
287291 Object . entries ( chunk ) . forEach ( ( [ uid , suite ] ) => {
288- if ( ! suite ?. uid ) return
292+ if ( ! suite ?. uid ) {
293+ return
294+ }
289295
290- console . log ( '[DataManager] Processing incoming suite:' , uid , suite . title )
291296 const existing = suiteMap . get ( uid )
292297
293298 // Always merge to preserve all tests in the suite
294299 suiteMap . set ( uid , existing ? this . #mergeSuite( existing , suite ) : suite )
295300 } )
296301 } )
297302
298- console . log ( '[DataManager] Final suite map size:' , suiteMap . size )
299-
300303 this . suitesContextProvider . setValue (
301304 Array . from ( suiteMap . entries ( ) ) . map ( ( [ uid , suite ] ) => ( { [ uid ] : suite } ) )
302305 )
303306 }
304307
305308 #getTimestamp( date : Date | number | undefined ) : number {
306- if ( ! date ) return 0
309+ if ( ! date ) {
310+ return 0
311+ }
307312 return date instanceof Date ? date . getTime ( ) : date
308313 }
309314
@@ -330,10 +335,14 @@ export class DataManagerController implements ReactiveController {
330335
331336 // First merge tests and suites properly
332337 const mergedTests = this . #mergeTests( existing . tests , incoming . tests )
333- const mergedSuites = this . #mergeChildSuites( existing . suites , incoming . suites )
338+ const mergedSuites = this . #mergeChildSuites(
339+ existing . suites ,
340+ incoming . suites
341+ )
334342
335343 // Then merge suite properties, ensuring merged tests/suites are preserved
336- const { tests : _incomingTests , suites : _incomingSuites , ...incomingProps } = incoming
344+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
345+ const { tests, suites, ...incomingProps } = incoming
337346
338347 return {
339348 ...existing ,
@@ -351,23 +360,24 @@ export class DataManagerController implements ReactiveController {
351360 prev ?. forEach ( ( suite ) => suite && map . set ( suite . uid , suite ) )
352361
353362 next ?. forEach ( ( suite ) => {
354- if ( ! suite ) return
363+ if ( ! suite ) {
364+ return
365+ }
355366 const existing = map . get ( suite . uid )
356367 map . set ( suite . uid , existing ? this . #mergeSuite( existing , suite ) : suite )
357368 } )
358369
359370 return Array . from ( map . values ( ) )
360371 }
361372
362- #mergeTests(
363- prev : TestStatsFragment [ ] = [ ] ,
364- next : TestStatsFragment [ ] = [ ]
365- ) {
373+ #mergeTests( prev : TestStatsFragment [ ] = [ ] , next : TestStatsFragment [ ] = [ ] ) {
366374 const map = new Map < string , TestStatsFragment > ( )
367375 prev ?. forEach ( ( test ) => test && map . set ( test . uid , test ) )
368376
369377 next ?. forEach ( ( test ) => {
370- if ( ! test ) return
378+ if ( ! test ) {
379+ return
380+ }
371381 const existing = map . get ( test . uid )
372382
373383 // Check if this test is a rerun (different start time)
@@ -378,7 +388,10 @@ export class DataManagerController implements ReactiveController {
378388 this . #getTimestamp( test . start ) !== this . #getTimestamp( existing . start )
379389
380390 // Replace on rerun, merge on normal update
381- map . set ( test . uid , isRerun ? test : existing ? { ...existing , ...test } : test )
391+ map . set (
392+ test . uid ,
393+ isRerun ? test : existing ? { ...existing , ...test } : test
394+ )
382395 } )
383396
384397 return Array . from ( map . values ( ) )
0 commit comments