Version
v20.3.0
Platform
Darwin mbp-nohehf.local 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 arm64
Subsystem
No response
What steps will reproduce the bug?
Having the following minimal reproduction files:
// index.js
import { run } from "node:test";
import process from "node:process";
import { spec } from "node:test/reporters";
run({
files: ["./test.js"],
})
.compose(spec)
.pipe(process.stdout);
// test.js
import { it } from "node:test";
import assert from "node:assert";
it("should work", () => {
assert.equal(1, 1);
});
Running test.js file via the cli using node --test test.js outputs (as expected):

Running test.js file programmatically via index.js, using node index.js outputs nothing and exits with status code 1.

How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
Using spec reporter should work programmatically, as tap reporter does.
What do you see instead?
Using spec reporter programmatically outputs nothing and exits with status code 1.
Additional information
No response
Version
v20.3.0
Platform
Darwin mbp-nohehf.local 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 arm64
Subsystem
No response
What steps will reproduce the bug?
Having the following minimal reproduction files:
Running test.js file via the cli using

node --test test.jsoutputs (as expected):Running test.js file programmatically via index.js, using

node index.jsoutputs nothing and exits with status code 1.How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
Using spec reporter should work programmatically, as tap reporter does.
What do you see instead?
Using spec reporter programmatically outputs nothing and exits with status code 1.
Additional information
No response