File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ function mapRangeToLines(range, lines) {
313313 mid = MathFloor ( ( start + end ) / 2 ) ;
314314 let line = lines [ mid ] ;
315315
316- if ( startOffset >= line . startOffset && startOffset <= line . endOffset ) {
316+ if ( startOffset >= line ? .startOffset && startOffset <= line ? .endOffset ) {
317317 while ( endOffset > line ?. startOffset ) {
318318 // If the range is not covered, and the range covers the entire line,
319319 // then mark that line as not covered.
@@ -333,7 +333,7 @@ function mapRangeToLines(range, lines) {
333333 }
334334
335335 break ;
336- } else if ( startOffset >= line . endOffset ) {
336+ } else if ( startOffset >= line ? .endOffset ) {
337337 start = mid + 1 ;
338338 } else {
339339 end = mid - 1 ;
Original file line number Diff line number Diff line change @@ -737,6 +737,7 @@ class Test extends AsyncResource {
737737 this . reported = true ;
738738 reporter . plan ( nesting , loc , harness . counters . topLevel ) ;
739739
740+ const coverage = harness . coverage ( ) ; // Call this before printing diagnostics, since failure to collect coverage is a diagnostic.
740741 for ( let i = 0 ; i < diagnostics . length ; i ++ ) {
741742 reporter . diagnostic ( nesting , loc , diagnostics [ i ] ) ;
742743 }
@@ -750,8 +751,6 @@ class Test extends AsyncResource {
750751 reporter . diagnostic ( nesting , loc , `todo ${ harness . counters . todo } ` ) ;
751752 reporter . diagnostic ( nesting , loc , `duration_ms ${ this . duration ( ) } ` ) ;
752753
753- const coverage = harness . coverage ( ) ;
754-
755754 if ( coverage ) {
756755 reporter . coverage ( nesting , loc , coverage ) ;
757756 }
You can’t perform that action at this time.
0 commit comments