mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
doc: add test:coverage event to custom reporter examples
PR-URL: https://github.com/nodejs/node/pull/46752 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
b2cfcf9cd8
commit
fc319d6a4f
1 file changed
+20
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user