mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: jarred <jarred@bun.sh> Co-authored-by: pfg <pfg@pfg.pw>
24 lines
618 B
TypeScript
24 lines
618 B
TypeScript
import { spawnSync } from "bun";
|
|
import { describe, expect, test } from "bun:test";
|
|
import { bunExe } from "harness";
|
|
|
|
describe("spawnSync with ReadableStream stdin", () => {
|
|
test("spawnSync should throw", () => {
|
|
const stream = new ReadableStream({
|
|
async start(controller) {
|
|
await 42;
|
|
controller.enqueue("test data");
|
|
controller.close();
|
|
},
|
|
});
|
|
|
|
expect(() =>
|
|
spawnSync({
|
|
cmd: [bunExe()],
|
|
stdin: stream,
|
|
stdout: "pipe",
|
|
}),
|
|
).toThrowErrorMatchingInlineSnapshot(`"'stdin' ReadableStream cannot be used in sync mode"`);
|
|
});
|
|
});
|