aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/spawned-child.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/bun.js/spawned-child.js')
-rw-r--r--test/bun.js/spawned-child.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/bun.js/spawned-child.js b/test/bun.js/spawned-child.js
index 757aacd5c..c70aeab16 100644
--- a/test/bun.js/spawned-child.js
+++ b/test/bun.js/spawned-child.js
@@ -1 +1,11 @@
-setTimeout(() => console.log("hello"), 150);
+if (process.argv[2] === "STDIN") {
+ let result = "";
+ process.stdin.on("data", (data) => {
+ result += data;
+ });
+ process.stdin.on("close", () => {
+ console.log(result);
+ });
+} else {
+ setTimeout(() => console.log("hello"), 150);
+}