fix(test): assert negative pid in start full-stop test

killProcessTree on Unix targets the process group first via
process.kill(-pid, signal); only falls back to positive pid if that
throws. The test mock returns true, so only the negative-pid call
ever fires. Update assertion to match the actual call.

Caught by CI on Linux (test was Windows-skipped locally).
This commit is contained in:
Priyanshu Choudhary 2026-04-29 04:41:46 +05:30
parent e071f63e5a
commit 170c1ca7f7
1 changed files with 4 additions and 1 deletions

View File

@ -2004,7 +2004,10 @@ describe("start command — platform-aware runtime fallback", () => {
await program.parseAsync(["node", "test", "stop"]);
expect(killSpy).toHaveBeenCalledWith(99999, "SIGTERM");
// killProcessTree on Unix targets the process group first via NEGATIVE pid;
// only falls back to positive pid if that throws. The mock returns true,
// so only the negative-pid call fires.
expect(killSpy).toHaveBeenCalledWith(-99999, "SIGTERM");
expect(mockUnregister).toHaveBeenCalled();
expect(mockRemoveProjectFromRunning).not.toHaveBeenCalled();