-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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-reporter
and --test-reporter-destination
flags are ignored if provided after script files
#48177
Comments
This is basically the difference between If anyone decides to work on this, it will likely either require changes to Node's internal command line argument parser to support this use case (which I would not advise), or doing another pass of command line argument parsing in the test runner itself on |
I don't know, but I've found it also happens with |
--test-reporter
flag ignored if provided after script files--test-reporter
and --test-reporter-destination
flags are ignored if provided after script files
how is this different that any other node flag? running |
Then maybe the issue is in the flags parser? That all of them should be accepted after the files? |
I think the separation is necessary. |
I don't remember the exact details, but I think it's not working that way, that the My particular use case and the reason why I open this issue, is because I like to have a |
no, it's simply the first positional argument (the main file name) that makes the distinction.
you can write a script that prases args and passes them to node, or use |
Is there any CLI arg to define the script file(s), or just only positional arguments? That could be another alternative, so no positional arguments are provided. |
This did the trick, thanks :-) |
Version
v20.2.0
Platform
Linux executive 5.19.0-42-generic #43-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 18 18:21:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
test runner
What steps will reproduce the bug?
Exec the test runner with the
--test-reporter
after specifying some scripts in the CLI, likenode --experimental-test-coverage test.js dist/test.js --test-reporter=@mafalda-sfu/test-reporter-json
.How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior? Why is that the expected behavior?
Provided reporter should be used.
What do you see instead?
Flag is ignored, and default
spec
reporter is being used.Additional information
When provided the flag before the scripts, like in
node --experimental-test-coverage --test-reporter=@mafalda-sfu/test-reporter-json test.js dist/test.js
, reporter is being properly used.The text was updated successfully, but these errors were encountered: