Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fc319d6

Browse filesBrowse files
richiemccolltargos
authored andcommitted
doc: add test:coverage event to custom reporter examples
PR-URL: #46752 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent b2cfcf9 commit fc319d6
Copy full SHA for fc319d6

File tree

Expand file treeCollapse file tree

1 file changed

+20
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+20
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/test.md‎

Copy file name to clipboardExpand all lines: doc/api/test.md
+20Lines changed: 20 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,11 @@ const customReporter = new Transform({
555555
case 'test:diagnostic':
556556
callback(null, event.data.message);
557557
break;
558+
case 'test:coverage': {
559+
const { totalLineCount } = event.data.summary.totals;
560+
callback(null, `total line count: ${totalLineCount}\n`);
561+
break;
562+
}
558563
}
559564
},
560565
});
@@ -584,6 +589,11 @@ const customReporter = new Transform({
584589
case 'test:diagnostic':
585590
callback(null, event.data.message);
586591
break;
592+
case 'test:coverage': {
593+
const { totalLineCount } = event.data.summary.totals;
594+
callback(null, `total line count: ${totalLineCount}\n`);
595+
break;
596+
}
587597
}
588598
},
589599
});
@@ -612,6 +622,11 @@ export default async function * customReporter(source) {
612622
case 'test:diagnostic':
613623
yield `${event.data.message}\n`;
614624
break;
625+
case 'test:coverage': {
626+
const { totalLineCount } = event.data.summary.totals;
627+
yield `total line count: ${totalLineCount}\n`;
628+
break;
629+
}
615630
}
616631
}
617632
}
@@ -636,6 +651,11 @@ module.exports = async function * customReporter(source) {
636651
case 'test:diagnostic':
637652
yield `${event.data.message}\n`;
638653
break;
654+
case 'test:coverage': {
655+
const { totalLineCount } = event.data.summary.totals;
656+
yield `total line count: ${totalLineCount}\n`;
657+
break;
658+
}
639659
}
640660
}
641661
};

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.