Skip to content

Commit fc319d6

Browse 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

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/api/test.md

Lines changed: 20 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy