Files
bun.sh/test/regression/issue/20144/20144.test.ts
2025-06-03 23:41:37 -07:00

26 lines
661 B
TypeScript

import { it } from "bun:test";
import assert from "node:assert";
import { spawn } from "node:child_process";
it.skipIf(process.platform === "win32")("should not time out", done => {
const child = spawn(process.execPath, ["run", "./20144.fixture.ts"], {
cwd: __dirname,
stdio: [null, "inherit", "inherit", "ipc"],
timeout: 1000,
killSignal: "SIGKILL",
});
child.on("message", message => {
if (message == "hej") {
assert.ok(child.pid);
process.kill(child.pid, "SIGINT");
}
});
child.on("exit", (code, signal) => {
assert.strictEqual(signal, "SIGINT");
assert.strictEqual(code, null);
done();
});
});