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) {
313
313
mid = MathFloor ( ( start + end ) / 2 ) ;
314
314
let line = lines [ mid ] ;
315
315
316
- if ( startOffset >= line . startOffset && startOffset <= line . endOffset ) {
316
+ if ( startOffset >= line ? .startOffset && startOffset <= line ? .endOffset ) {
317
317
while ( endOffset > line ?. startOffset ) {
318
318
// If the range is not covered, and the range covers the entire line,
319
319
// then mark that line as not covered.
@@ -333,7 +333,7 @@ function mapRangeToLines(range, lines) {
333
333
}
334
334
335
335
break ;
336
- } else if ( startOffset >= line . endOffset ) {
336
+ } else if ( startOffset >= line ? .endOffset ) {
337
337
start = mid + 1 ;
338
338
} else {
339
339
end = mid - 1 ;
Original file line number Diff line number Diff line change @@ -737,6 +737,7 @@ class Test extends AsyncResource {
737
737
this . reported = true ;
738
738
reporter . plan ( nesting , loc , harness . counters . topLevel ) ;
739
739
740
+ const coverage = harness . coverage ( ) ; // Call this before printing diagnostics, since failure to collect coverage is a diagnostic.
740
741
for ( let i = 0 ; i < diagnostics . length ; i ++ ) {
741
742
reporter . diagnostic ( nesting , loc , diagnostics [ i ] ) ;
742
743
}
@@ -750,8 +751,6 @@ class Test extends AsyncResource {
750
751
reporter . diagnostic ( nesting , loc , `todo ${ harness . counters . todo } ` ) ;
751
752
reporter . diagnostic ( nesting , loc , `duration_ms ${ this . duration ( ) } ` ) ;
752
753
753
- const coverage = harness . coverage ( ) ;
754
-
755
754
if ( coverage ) {
756
755
reporter . coverage ( nesting , loc , coverage ) ;
757
756
}
You can’t perform that action at this time.
0 commit comments