From dcc18fb355a3504ddccf4dc2e16b74e852529eee Mon Sep 17 00:00:00 2001 From: Ashcon Partovi Date: Thu, 20 Jun 2024 15:18:10 -0700 Subject: [PATCH] Fix test --- test/js/bun/spawn/spawn.test.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/js/bun/spawn/spawn.test.ts b/test/js/bun/spawn/spawn.test.ts index 8ca7172375..451143d03c 100644 --- a/test/js/bun/spawn/spawn.test.ts +++ b/test/js/bun/spawn/spawn.test.ts @@ -48,7 +48,7 @@ for (let [gcTick, label] of [ it("Uint8Array works as stdin", async () => { const { stdout, stderr } = spawnSync({ - cmd: [shellExe(), "-c", "cat"], + cmd: [bunExe(), "-e", "process.stdin.pipe(process.stdout)"], stdin: new TextEncoder().encode(hugeString), }); gcTick(); @@ -125,7 +125,7 @@ for (let [gcTick, label] of [ const stdinPath = join(tmpdirSync(), "stdin.txt"); gcTick(); const { exited } = spawn({ - cmd: [shellExe(), "-c", "cat"], + cmd: [bunExe(), "-e", "process.stdin.pipe(process.stdout)"], stdin: new TextEncoder().encode(hugeString), stdout: Bun.file(stdinPath), }); @@ -271,7 +271,7 @@ for (let [gcTick, label] of [ const stdinPath = join(tmpdirSync(), "stdin.txt"); gcTick(); const { exited } = spawn({ - cmd: [shellExe(), "-c", "cat"], + cmd: [bunExe(), "-e", "process.stdin.pipe(process.stdout)"], stdin: new Blob([new TextEncoder().encode(hugeString)]), stdout: Bun.file(stdinPath), }); @@ -298,7 +298,7 @@ for (let [gcTick, label] of [ writeFileSync(stdinPath, "hello there!"); gcTick(); const { stdout } = spawn({ - cmd: [shellExe(), "-c", "cat"], + cmd: [bunExe(), "-e", "process.stdin.pipe(process.stdout)"], stdout: "pipe", stdin: Bun.file(stdinPath), }); @@ -315,7 +315,7 @@ for (let [gcTick, label] of [ gcTick(); const { exited } = spawn({ - cmd: [shellExe(), "-c", "cat"], + cmd: [bunExe(), "-e", "process.stdin.pipe(process.stdout)"], stdout: Bun.file(stdoutPath), stdin: Bun.file(stdinPath), }); @@ -334,7 +334,7 @@ for (let [gcTick, label] of [ const statusCodes = new Array(10); for (let i = 0; i < promises.length; i++) { const { stdout, exited } = spawn({ - cmd: [shellExe(), "-c", "cat", filePath], + cmd: [bunExe(), "-e", "process.stdin.pipe(process.stdout)"], stdout: "pipe", stdin: "ignore", stderr: "inherit", @@ -423,7 +423,7 @@ for (let [gcTick, label] of [ describe("pipe", () => { function huge() { return spawn({ - cmd: [shellExe(), "-c", "cat"], + cmd: [bunExe(), "-e", "process.stdin.pipe(process.stdout)"], stdout: "pipe", stdin: new Blob([hugeString + "\n"]), stderr: "inherit",