Repository Public
1import { existsSync, readFileSync } from "node:fs";2import { resolve } from "node:path";34/** Stops the media worker started by the global setup — by its PID, nothing else. */5export default function globalTeardown() {6 const file = resolve("e2e/.tmp/studio/state.json");7 if (!existsSync(file)) return;8 const { workerPid } = JSON.parse(readFileSync(file, "utf8")) as { workerPid?: number };9 if (workerPid) try { process.kill(workerPid, "SIGTERM"); } catch { /* already stopped */ }10}11