fix: restore recent test regressions and upgrade effect beta (#18158)

This commit is contained in:
Luke Parker
2026-03-19 09:54:01 +10:00
committed by GitHub
parent 81be544981
commit 5d2f8d77f9
11 changed files with 79 additions and 46 deletions

View File

@@ -109,4 +109,20 @@ describe("util.process", () => {
expect(await proc.exited).toBe(0)
})
test("rejects missing commands without leaking unhandled errors", async () => {
await using tmp = await tmpdir()
const cmd = path.join(tmp.path, "missing" + (process.platform === "win32" ? ".cmd" : ""))
const err = await Process.spawn([cmd], {
stdin: "pipe",
stdout: "pipe",
stderr: "pipe",
}).exited.catch((err) => err)
expect(err).toBeInstanceOf(Error)
if (!(err instanceof Error)) throw err
expect(err).toMatchObject({
code: "ENOENT",
})
})
})