Files
paseo/packages/desktop/scripts/dev-runner-config.test.mjs
T
Mohamed Boudra d17194c611 fix(desktop): stop dev app surviving its terminal
Electron was detached from the desktop runner, allowing it to outlive a stopped workspace terminal with broken output pipes and retain the single-instance lock. Keep Electron owned by the runner and preserve explicit process-group cleanup for detached child trees.
2026-07-31 17:17:54 +02:00

27 lines
819 B
JavaScript

import { describe, expect, test } from "vitest";
import { createElectronSpawnOptions, resolveChildKillTarget } from "./dev-runner-config.mjs";
describe("desktop dev process ownership", () => {
test("keeps Electron in the runner process group", () => {
const options = createElectronSpawnOptions({
env: { PATH: "/usr/bin" },
colorEnv: { FORCE_COLOR: "1" },
expoDevUrl: "http://localhost:8082",
});
expect(options).toMatchObject({
detached: false,
env: {
PATH: "/usr/bin",
FORCE_COLOR: "1",
EXPO_DEV_URL: "http://localhost:8082",
},
});
});
test("targets the whole process group for detached child trees", () => {
expect(resolveChildKillTarget(42, true)).toBe(-42);
expect(resolveChildKillTarget(42, false)).toBe(42);
});
});