Skip to content

Test runner run function crashing #47231

Closed
@jeanbmar

Description

@jeanbmar

Version

v18.15.0

Platform

Microsoft Windows NT 10.0.19045.0 x64

Subsystem

No response

What steps will reproduce the bug?

import { run } from 'node:test';

run({ files: [] }).pipe(process.stdout);

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that are suitable for first-time contributors.test_runnerIssues and PRs related to the test runner subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions