Skip to content

Commit e53738e

Browse files
committed
fix(test): add missing on() mock for spawn error listener
1 parent 96404cb commit e53738e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/infra/process-respawn.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ describe("restartGatewayProcessWithFreshPid", () => {
170170
setPlatform("linux");
171171
process.execArgv = ["--import", "tsx"];
172172
process.argv = ["/usr/local/bin/node", "/repo/dist/index.js", "gateway", "run"];
173-
spawnMock.mockReturnValue({ pid: 4242, unref: vi.fn() });
173+
spawnMock.mockReturnValue({ pid: 4242, on: vi.fn(), unref: vi.fn() });
174174

175175
const result = restartGatewayProcessWithFreshPid();
176176

@@ -302,7 +302,7 @@ describe("respawnGatewayProcessForUpdate", () => {
302302
"gateway",
303303
"run",
304304
];
305-
spawnMock.mockReturnValue({ pid: 5151, unref: vi.fn(), kill: vi.fn() });
305+
spawnMock.mockReturnValue({ pid: 5151, on: vi.fn(), unref: vi.fn(), kill: vi.fn() });
306306

307307
const result = respawnGatewayProcessForUpdate();
308308

@@ -329,7 +329,7 @@ describe("respawnGatewayProcessForUpdate", () => {
329329
"gateway",
330330
"run",
331331
];
332-
spawnMock.mockReturnValue({ pid: 7171, unref: vi.fn(), kill: vi.fn() });
332+
spawnMock.mockReturnValue({ pid: 7171, on: vi.fn(), unref: vi.fn(), kill: vi.fn() });
333333

334334
const result = respawnGatewayProcessForUpdate();
335335

@@ -352,7 +352,7 @@ describe("respawnGatewayProcessForUpdate", () => {
352352
const entry =
353353
"/app/node_modules/.pnpm/@[email protected]/node_modules/@anthropic/sdk/dist/index.js";
354354
process.argv = ["/usr/local/bin/node", entry, "gateway", "run"];
355-
spawnMock.mockReturnValue({ pid: 8181, unref: vi.fn(), kill: vi.fn() });
355+
spawnMock.mockReturnValue({ pid: 8181, on: vi.fn(), unref: vi.fn(), kill: vi.fn() });
356356

357357
respawnGatewayProcessForUpdate();
358358

@@ -369,7 +369,7 @@ describe("respawnGatewayProcessForUpdate", () => {
369369
process.env.XPC_SERVICE_NAME = "ai.openclaw.mac";
370370
process.execArgv = [];
371371
process.argv = ["/usr/local/bin/node", "/repo/dist/index.js", "gateway", "run"];
372-
spawnMock.mockReturnValue({ pid: 6161, unref: vi.fn(), kill: vi.fn() });
372+
spawnMock.mockReturnValue({ pid: 6161, on: vi.fn(), unref: vi.fn(), kill: vi.fn() });
373373

374374
const result = respawnGatewayProcessForUpdate();
375375

0 commit comments

Comments
 (0)