mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
21 lines
667 B
TypeScript
21 lines
667 B
TypeScript
import { describe, expect, it, vi } from "vitest";
|
|
|
|
vi.mock("./processTree.js", () => ({
|
|
terminateProcessTree: () => Promise.reject(new Error("taskkill exited with status 128")),
|
|
}));
|
|
|
|
const { runCancellableProcess } = await import("./cancellableProcess.js");
|
|
|
|
describe("runCancellableProcess when the tree kill fails", () => {
|
|
it("still rejects with the timeout, not the kill failure", async () => {
|
|
const run = runCancellableProcess(process.execPath, ["-e", "setTimeout(() => {}, 400)"], {
|
|
timeoutMs: 50,
|
|
});
|
|
|
|
await expect(run).rejects.toMatchObject({
|
|
message: "Process timed out after 50 ms",
|
|
code: "ETIMEDOUT",
|
|
});
|
|
});
|
|
});
|