@@ -583,27 +583,30 @@ test('coverage ignore comments exclude branches in LCOV output', skipIfNoInspect
583583 assert . strictEqual ( result . status , 0 ) ;
584584
585585 // Extract the source.js section from LCOV output
586- const sourceSection = lcov . split ( 'end_of_record' )
587- . find ( ( s ) => s . includes ( 'source.js' ) ) ;
586+ const sourceSection = lcov . split ( 'end_of_record' ) . find ( ( s ) => s . includes ( 'source.js' ) ) ;
588587 assert ( sourceSection , 'LCOV should contain source.js coverage' ) ;
589588
590589 // Verify that all branches are reported as covered (BRH should equal BRF)
591590 // The ignored branch should not penalize coverage
592591 const brfMatch = sourceSection . match ( / B R F : ( \d + ) / ) ;
593592 const brhMatch = sourceSection . match ( / B R H : ( \d + ) / ) ;
594- assert ( brfMatch , 'LCOV should contain BRF' ) ;
595- assert ( brhMatch , 'LCOV should contain BRH' ) ;
596- assert . strictEqual ( brfMatch [ 1 ] , brhMatch [ 1 ] ,
597- `All branches should be covered when ignored code is not executed. ` +
598- `BRF=${ brfMatch [ 1 ] } , BRH=${ brhMatch [ 1 ] } ` ) ;
593+ assert . match ( sourceSection , / B R F : ( \d + ) / , 'LCOV should contain BRF' ) ;
594+ assert . match ( sourceSection , / B R H : ( \d + ) / , 'LCOV should contain BRH' ) ;
595+ assert . strictEqual (
596+ brfMatch [ 1 ] ,
597+ brhMatch [ 1 ] ,
598+ `All branches should be covered when ignored code is not executed. BRF=${ brfMatch [ 1 ] } , BRH=${ brhMatch [ 1 ] } ` ,
599+ ) ;
599600
600601 // Verify no BRDA entries show 0 (uncovered) for the ignored branch
601602 // The branch at the if statement should be covered, not penalized by the ignored return
602603 const brdaEntries = sourceSection . match ( / B R D A : \d + , \d + , \d + , ( \d + ) / g) || [ ] ;
603604 for ( const entry of brdaEntries ) {
604605 const count = entry . match ( / B R D A : \d + , \d + , \d + , ( \d + ) / ) [ 1 ] ;
605- assert . notStrictEqual ( count , '0' ,
606- `No branch should show 0 coverage when the ` +
607- `uncovered path is ignored: ${ entry } ` ) ;
606+ assert . notStrictEqual (
607+ count ,
608+ '0' ,
609+ `No branch should show 0 coverage when the uncovered path is ignored: ${ entry } ` ,
610+ ) ;
608611 }
609612} ) ;
0 commit comments