diff --git a/doc/api/test.md b/doc/api/test.md index 9b8b0940f265ca..849a1a77fbb53e 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -555,6 +555,11 @@ const customReporter = new Transform({ case 'test:diagnostic': callback(null, event.data.message); break; + case 'test:coverage': { + const { totalLineCount } = event.data.summary.totals; + callback(null, `total line count: ${totalLineCount}\n`); + break; + } } }, }); @@ -584,6 +589,11 @@ const customReporter = new Transform({ case 'test:diagnostic': callback(null, event.data.message); break; + case 'test:coverage': { + const { totalLineCount } = event.data.summary.totals; + callback(null, `total line count: ${totalLineCount}\n`); + break; + } } }, }); @@ -612,6 +622,11 @@ export default async function * customReporter(source) { case 'test:diagnostic': yield `${event.data.message}\n`; break; + case 'test:coverage': { + const { totalLineCount } = event.data.summary.totals; + yield `total line count: ${totalLineCount}\n`; + break; + } } } } @@ -636,6 +651,11 @@ module.exports = async function * customReporter(source) { case 'test:diagnostic': yield `${event.data.message}\n`; break; + case 'test:coverage': { + const { totalLineCount } = event.data.summary.totals; + yield `total line count: ${totalLineCount}\n`; + break; + } } } };