aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/spawn.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/bun.js/spawn.test.ts')
-rw-r--r--test/bun.js/spawn.test.ts18
1 files changed, 8 insertions, 10 deletions
diff --git a/test/bun.js/spawn.test.ts b/test/bun.js/spawn.test.ts
index 0d62d0a5b..a393922c0 100644
--- a/test/bun.js/spawn.test.ts
+++ b/test/bun.js/spawn.test.ts
@@ -1,20 +1,18 @@
-import { test, expect, it, describe } from "bun:test";
import { readableStreamToText, spawn } from "bun";
+import { describe, expect, it } from "bun:test";
describe("spawn", () => {
const hugeString = "hello".repeat(100000).slice();
- it("stdin can write", async () => {
- const { stdin, stdout } = spawn({
- cmd: ["cat"],
- stdin: "pipe",
+ it("stdout can be read", async () => {
+ await Bun.write("/tmp/out.txt", hugeString);
+ const { stdout } = spawn({
+ cmd: ["cat", "/tmp/out.txt"],
stdout: "pipe",
});
- await stdin.write(hugeString);
- stdin.end();
- return readableStreamToText(stdout).then((text) => {
- expect(text).toBe(hugeString);
- });
+
+ const text = await readableStreamToText(stdout);
+ expect(text).toBe(hugeString);
});
describe("pipe", () => {