-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Example Custom Reporter Provides No Output at All When There's a Warning #48894
Labels
doc
Issues and PRs related to the documentations.
test_runner
Issues and PRs related to the test runner subsystem.
Comments
@machineghost the root cause is that we must invoke callback in transform handler to get next available chunk. So, example code is wrong due to incorrect stream usage. +1 to provide default case to the switch statement or change logic by introducing intermediate variable to store message and always invoke callback(null, message) at function end. |
atlowChemi
added
doc
Issues and PRs related to the documentations.
test_runner
Issues and PRs related to the test runner subsystem.
labels
Jul 24, 2023
atlowChemi
added a commit
to atlowChemi/node
that referenced
this issue
Jul 24, 2023
atlowChemi
added a commit
to atlowChemi/node
that referenced
this issue
Jul 25, 2023
Ceres6
pushed a commit
to Ceres6/node
that referenced
this issue
Jul 27, 2023
Fixes: nodejs#48894 PR-URL: nodejs#48903 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
pluris
pushed a commit
to pluris/node
that referenced
this issue
Aug 6, 2023
Fixes: nodejs#48894 PR-URL: nodejs#48903 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
pluris
pushed a commit
to pluris/node
that referenced
this issue
Aug 7, 2023
Fixes: nodejs#48894 PR-URL: nodejs#48903 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Ceres6
pushed a commit
to Ceres6/node
that referenced
this issue
Aug 14, 2023
Fixes: nodejs#48894 PR-URL: nodejs#48903 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Ceres6
pushed a commit
to Ceres6/node
that referenced
this issue
Aug 14, 2023
Fixes: nodejs#48894 PR-URL: nodejs#48903 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
UlisesGascon
pushed a commit
to UlisesGascon/node
that referenced
this issue
Aug 14, 2023
Fixes: nodejs#48894 PR-URL: nodejs#48903 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
sercher
added a commit
to sercher/graaljs
that referenced
this issue
Apr 25, 2024
Fixes: nodejs/node#48894 PR-URL: nodejs/node#48903 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
sercher
added a commit
to sercher/graaljs
that referenced
this issue
Apr 25, 2024
Fixes: nodejs/node#48894 PR-URL: nodejs/node#48903 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
doc
Issues and PRs related to the documentations.
test_runner
Issues and PRs related to the test runner subsystem.
Version
20.3.0
Platform
Linux mycomputer 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
test
What steps will reproduce the bug?
--test-reporter=./test/testReporter.js
tonode test testFile.js
--experimental-loader ./loader.js
)How often does it reproduce? Is there a required condition?
100% reproducible (for me at least)
What is the expected behavior? Why is that the expected behavior?
You see some (customized) test output.
What do you see instead?
You see nothing:
Additional information
First off, let me just say the built-in Node test runner is great (or at least a really great start), and I very much appreciate this feature! No more mocha/jest/ava/other annoying dependencies!
As for the issue, this is happening because the example test reporter has a
switch
/case
statement, and it doesn't include acase
for whenevent.type
===
'test:stderr'
. If you add:to the custom reporter's
switch
, you instead see:As someone new to custom reporters, it was very confusing to add the example one and get absolutely no output whatsoever. It seems to me that the sample test reporter should either:
A) If unexpected events (eg. warnings) are "errors", the sample test runner should treat them as such:
B) if warnings and other events are expected (as it seems they should be), but they shouldn't output, that should instead be:
C) If warnings are expected, and should output (I think this is correct) it should be:
However, if you go with C), it seems some sort of
default
(like A or B) should be included also, to handle any other unexpected events in some way (besides silently swallowing them).The text was updated successfully, but these errors were encountered: