fix(test): skip flaky extra fd input on windows

This commit is contained in:
Kit Langton
2026-03-23 22:38:39 -04:00
parent 5274f59d88
commit c9ada22e35

View File

@@ -319,15 +319,14 @@ describe("cross-spawn spawner", () => {
})
test("writes data to input fd3", async () => {
if (process.platform === "win32") return
const out = await runScoped(
Effect.gen(function* () {
const input = Stream.make(new TextEncoder().encode("data from parent"))
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 handle = yield* js('process.stdout.write(require("node:fs").readFileSync(3, "utf8"))', {
additionalFds: { fd3: { type: "input", stream: input } },
})
const stdout = yield* decodeByteStream(handle.stdout)
yield* handle.exitCode
return stdout