-
Notifications
You must be signed in to change notification settings - Fork 30k
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: handled change for exposing 'spec' reporter #48202
Conversation
Other reporters (dot, tap) by signature are a function while 'spec' reporter is a ES6 class. This behaviour of api spec is causing difference in semantics while consumption since it has not been addressed anywhere in the document (it has to be instantiated). Instead of making changes in the signature of spec.js, i have proposed changes where the 'spec' reporter gets exposed in reporter.js Fixes: nodejs#48112 Refs: https://github.com/nodejs/node/blob/main/lib/internal/test_runner/reporter/spec.js Refs: (@line-no:143) https://github.com/nodejs/node/blob/main/lib/internal/test_runner/utils.js
Review requested:
|
I do not understand why is the test failing @line-no:79 test-runner-run.mjs. |
you should debug locally with |
|
value: spec ?? function SpecReporter() { | ||
return ReflectConstruct(require('internal/test_runner/reporter/spec'), arguments); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value: spec ?? function SpecReporter() { | |
return ReflectConstruct(require('internal/test_runner/reporter/spec'), arguments); | |
value: function SpecReporter() { | |
spec ??= require('internal/test_runner/reporter/spec'); | |
return ReflectConstruct(spec, arguments, new.target); |
(not sure about the new.target
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me run full test this time on my local and check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@atlowChemi I have tried all versions of returning instance of a class (imported with require
), either with new keyword or with Reflect.construct, and both are not working.
I am not able to identify the Root cause.
@Sumi0 are you still planning to work on this, or should it be closed? |
This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open. |
This was already superseded by #49184 |
Fixes: Issue#48112
Other reporters (dot, tap) by signature are a function while 'spec'
reporter is a ES6 class.
This behaviour of api spec is causing difference in semantics while
consumption since it has not been addressed anywhere in the document
(it has to be instantiated).
Instead of making changes in the signature of spec.js, i have proposed
changes where the 'spec' reporter gets exposed in reporter.js
Refs: reporter/spec.js
Refs: (@line-no:143) test_runner/utils.js