fix(test): stream extra fd input on windows

This commit is contained in:
Kit Langton
2026-03-23 22:27:55 -04:00
parent d067fbe3fd
commit 5274f59d88

View File

@@ -322,9 +322,12 @@ describe("cross-spawn spawner", () => {
const out = await runScoped(
Effect.gen(function* () {
const input = Stream.make(new TextEncoder().encode("data from parent"))
const handle = yield* js('process.stdout.write(require("node:fs").readFileSync(3, "utf8"))', {
additionalFds: { fd3: { type: "input", stream: input } },
})
const handle = yield* js(
'const s = require("node:fs").createReadStream(null, { fd: 3 }); let out = ""; s.setEncoding("utf8"); s.on("data", (chunk) => out += chunk); s.on("end", () => process.stdout.write(out))',
{
additionalFds: { fd3: { type: "input", stream: input } },
},
)
const stdout = yield* decodeByteStream(handle.stdout)
yield* handle.exitCode
return stdout