Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runner: lcov in node:test/reporters is exported as a value #52385

Closed
yume-chan opened this issue Apr 6, 2024 · 0 comments · Fixed by #52403
Closed

test_runner: lcov in node:test/reporters is exported as a value #52385

yume-chan opened this issue Apr 6, 2024 · 0 comments · Fixed by #52403
Labels
test_runner Issues and PRs related to the test runner subsystem.

Comments

@yume-chan
Copy link
Contributor

yume-chan commented Apr 6, 2024

Version

v20.12.1

Platform

Microsoft Windows NT 10.0.26040.0 x64

Subsystem

No response

What steps will reproduce the bug?

import { lcov } from 'node:test/reporters'

const reporter = lcov()

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

lcov is a function which creates a new reporter, like all other exports in node:test/reporters (spec, dot, junit and tap)

What do you see instead?

lcov is an instance of LcovReporter class.

I think it's a typo at

lcov: {
__proto__: null,
configurable: true,
enumerable: true,
get() {
lcov ??= require('internal/test_runner/reporter/lcov');
return ReflectConstruct(lcov, arguments);
},
},

It should be defined as value, same as spec:

spec: {
__proto__: null,
configurable: true,
enumerable: true,
value: function value() {
spec ??= require('internal/test_runner/reporter/spec');
return ReflectConstruct(spec, arguments);
},
},

Additional information

No response

@VoltrexKeyva VoltrexKeyva added the test_runner Issues and PRs related to the test runner subsystem. label Apr 6, 2024
atlowChemi added a commit to atlowChemi/node that referenced this issue Apr 7, 2024
atlowChemi added a commit to atlowChemi/node that referenced this issue Apr 14, 2024
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: nodejs#52385
Ref: nodejs#49184
nodejs-github-bot pushed a commit that referenced this issue Apr 15, 2024
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: #52385
Ref: #49184
PR-URL: #52403
Refs: #49184
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
aduh95 pushed a commit that referenced this issue Apr 30, 2024
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: #52385
Ref: #49184
PR-URL: #52403
Refs: #49184
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants