test_runner: expose lcov reporter as newable function

This commit exposes the lcov reporter as a newable function, so that it
can be used in the same way as the other reporters.
This will allow passing in the options to the reporter as well.
This breaks the current behavior of the lcov reporter, which exposes an
instance of the reporter.

Fixes: https://github.com/nodejs/node/issues/52385
Ref: https://github.com/nodejs/node/pull/49184
PR-URL: https://github.com/nodejs/node/pull/52403
Refs: https://github.com/nodejs/node/pull/49184
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Chemi Atlow 2024-04-15 07:16:19 +03:00 committed by GitHub
parent f8e325ea8a
commit 0db38f0f99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,7 +50,7 @@ ObjectDefineProperties(module.exports, {
__proto__: null,
configurable: true,
enumerable: true,
get() {
value: function value() {
lcov ??= require('internal/test_runner/reporter/lcov');
return ReflectConstruct(lcov, arguments);
},