Regression test for 16702 (#16853)

This commit is contained in:
pfg
2025-01-28 17:23:57 -08:00
committed by GitHub
parent ea301d7235
commit 76f5c91ffb
3 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
import { bunExe } from "harness";
test("order", async () => {
const res = Bun.spawnSync({
cmd: [bunExe(), import.meta.dir + "/order-fixture.js"],
stdio: ["pipe", "pipe", "pipe"],
});
expect({
stdout: res.stdout.toString().replaceAll("\r", ""),
stderr: res.stderr.toString().replaceAll("\r", ""),
exitCode: res.exitCode,
}).toEqual({
stdout: "l1\nl2\nl3\n",
stderr: "",
exitCode: 0,
});
});
test("exit", async () => {
const res = Bun.spawnSync({
cmd: [bunExe(), import.meta.dir + "/exit-fixture.js"],
stdio: ["pipe", "pipe", "pipe"],
});
expect({
stdout: res.stdout.toString().replaceAll("\r", ""),
stderr: res.stderr.toString().replaceAll("\r", ""),
exitCode: res.exitCode,
}).toEqual({
stdout: "l1\nl2\n",
stderr: "",
exitCode: 0,
});
});

View File

@@ -0,0 +1,3 @@
process.stdout.write("l1\n");
process.stdout.write("l2\n");
process.exit(0);

View File

@@ -0,0 +1,3 @@
process.stdout.write("l1\n");
process.stdout.write("l2\n");
console.log("l3");