test_runner: handled change for exposing 'spec' reporter#48202
test_runner: handled change for exposing 'spec' reporter#48202Sumi0 wants to merge 3 commits intonodejs:mainfrom
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.
| 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.
Let me run full test this time on my local and check.
There was a problem hiding this comment.
@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