mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
Regression test for 16702 (#16853)
This commit is contained in:
33
test/regression/issue/16702/16702.test.ts
Normal file
33
test/regression/issue/16702/16702.test.ts
Normal 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,
|
||||
});
|
||||
});
|
||||
3
test/regression/issue/16702/exit-fixture.js
generated
Normal file
3
test/regression/issue/16702/exit-fixture.js
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
process.stdout.write("l1\n");
|
||||
process.stdout.write("l2\n");
|
||||
process.exit(0);
|
||||
3
test/regression/issue/16702/order-fixture.js
generated
Normal file
3
test/regression/issue/16702/order-fixture.js
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
process.stdout.write("l1\n");
|
||||
process.stdout.write("l2\n");
|
||||
console.log("l3");
|
||||
Reference in New Issue
Block a user