MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / stopTree

Function stopTree

e2e/local/vite-dev-routing.test.ts:53–71  ·  view source on GitHub ↗
(child: ChildProcess)

Source from the content-addressed store, hash-verified

51};
52
53const stopTree = async (child: ChildProcess): Promise<void> => {
54 if (child.pid === undefined || child.exitCode !== null) return;
55 try {
56 process.kill(-child.pid, "SIGTERM");
57 } catch {
58 child.kill("SIGTERM");
59 }
60 await Promise.race([
61 new Promise((resolve) => child.once("exit", resolve)),
62 new Promise((resolve) => setTimeout(resolve, 5_000)),
63 ]);
64 if (child.exitCode === null) {
65 try {
66 process.kill(-child.pid, "SIGKILL");
67 } catch {
68 child.kill("SIGKILL");
69 }
70 }
71};
72
73interface ViteDev {
74 readonly origin: string;

Callers 1

startPlainViteDevFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected