Move the logic for handling --test-reporter out of the general module loader and into the test_runner subsystem. PR-URL: https://github.com/nodejs/node/pull/45923 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
8 lines
254 B
JavaScript
8 lines
254 B
JavaScript
module.exports = async function * customReporter(source) {
|
|
const counters = {};
|
|
for await (const event of source) {
|
|
counters[event.type] = (counters[event.type] ?? 0) + 1;
|
|
}
|
|
yield "package: reporter-cjs";
|
|
yield JSON.stringify(counters);
|
|
};
|