test_runner API doc example invalid #47312
Labels
doc
Issues and PRs related to the documentations.
test_runner
Issues and PRs related to the test runner subsystem.
Affected URL(s)
https://nodejs.org/api/test.html
Description of the problem
This might also include some buggy behavior, though that could be down to a bad/deprecated example in the docs.
When attempting to run a test with the given example:
If there's any error in the calling file or the test, you get:
If there's no errors, then it just hangs with no output.
The same test runs fine with
node --test
.Observing the returned
TestsStream
for the listed events in the docs (['test:start', 'test:pass', 'test:fail', 'test:diagnostic', 'test:coverage']) and printing the resulting objects shows the test running fine.Also, using a TransformStream and printing the objects also shows the test running fine.
The error that's shown only when there's an actual error in the file (eg. passing a non-existent file to
files
forrun
) hints thatTestsStream
is now Object Mode which I guess can't be piped directly tostdout
without transformation of some sort.However, this error doesn't appear when the tests would run in the other aforementioned cases and
node
seems to just stop and sit there, it will print aconsole.log
message placed before and after therun
call and then just sit there indefinitely, even with atimeout
set, atimeout
verified working with the other methods.The text was updated successfully, but these errors were encountered: