You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there's any error in the calling file or the test, you get:
node:internal/streams/writable:315
throw new ERR_INVALID_ARG_TYPE(
^
TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object
at new NodeError (node:internal/errors:399:5)
at _write (node:internal/streams/writable:315:13)
at Writable.write (node:internal/streams/writable:337:10)
at TestsStream.ondata (node:internal/streams/readable:766:22)
at TestsStream.emit (node:events:512:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at #tryPush (node:internal/test_runner/tests_stream:69:28)
at #emit (node:internal/test_runner/tests_stream:64:18) {
code: 'ERR_INVALID_ARG_TYPE'
}
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 for run) hints that TestsStream is now Object Mode which I guess can't be piped directly to stdout 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 a console.log message placed before and after the run call and then just sit there indefinitely, even with a timeout set, a timeout verified working with the other methods.
The text was updated successfully, but these errors were encountered:
Hi, maybe partially a duplicate but the linked issue doesn't reference the separate issue I pointed out where it simply hangs, it only references when it has an exception.
Also, that issue is a bug report (which perhaps should be made regarding the hanging) while this is a docs issue; while the docs issue was referenced in the other issue, it's also presently closed (by bot, due to another related commit) without the docs fixed.
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: