Repository navigation
Test runner run function crashing #47231
Copy link
Copy link
Closed
Labels
good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
Activity
- changed the title
[-]Test runner run method crashing on Windows[/-][+]Test runner run function crashing on Windows[/+]on Mar 23, 2023 @cjihrig @nodejs/test_runner
Crashes on Linux too
runreturns atestsStreamwich is aReadablein object mode,
meaning you cannot pipe it directly to stdout without transforming it.
this error is expected- addedtest_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
on Mar 23, 2023 @MoLow then why official docs shows this
run({ files: [path.resolve('./tests/test.js')] }) .pipe(process.stdout);
And how are we supposed to parse the run output to generate something similar to
--test?I am reopening this for us to perform 2 action items:
- fix the example in the docs
- allow using reporters within the
runAPI, either by exposing the reporters or by adding an option torun
Reacted by Debadree Chatterjee, Jean-Baptiste M. and Toni Villena- addedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on Mar 23, 2023 - changed the title
[-]Test runner run function crashing on Windows[/-][+]Test runner run function crashing[/+]on Mar 23, 2023 - added a commit that references this issue
on Mar 28, 2023 - added a commit that references this issue
on Jul 6, 2023
Metadata
Metadata
Assignees
Labels
good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Version
v18.15.0
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always. Crashes as well when files is not empty.
What is the expected behavior? Why is that the expected behavior?
It shouldn't crash.
What do you see instead?
node:internal/test_runner/harness:45 throw err; ^ 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:513:28) at Readable.read (node:internal/streams/readable:539:10) at flow (node:internal/streams/readable:1023:34) at resume_ (node:internal/streams/readable:1004:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { code: 'ERR_INVALID_ARG_TYPE' }Additional information
No response