mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
26 lines
661 B
TypeScript
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();
|
|
});
|
|
});
|