





















@@ -92,21 +92,16 @@ describe("relaunchGatewayScheduledTask", () => {
92929393const result = relaunchGatewayScheduledTask({ OPENCLAW_PROFILE: "work" });
949495-expect(result).toMatchObject({
96-ok: true,
97-method: "schtasks",
98-tried: expect.arrayContaining(['schtasks /Run /TN "OpenClaw Gateway (work)"']),
99-});
95+expect(result.ok).toBe(true);
96+expect(result.method).toBe("schtasks");
97+expect(result.tried).toContain('schtasks /Run /TN "OpenClaw Gateway (work)"');
10098expect(result.tried).toContain(`cmd.exe /d /s /c ${seenCommandArg}`);
101-expect(spawnMock).toHaveBeenCalledWith(
102-"cmd.exe",
103-["/d", "/s", "/c", expect.any(String)],
104-expect.objectContaining({
105-detached: true,
106-stdio: "ignore",
107-windowsHide: true,
108-}),
109-);
99+const spawnCall = spawnMock.mock.calls[0];
100+expect(spawnCall?.[0]).toBe("cmd.exe");
101+expect(spawnCall?.[1]).toEqual(["/d", "/s", "/c", expect.any(String)]);
102+expect(spawnCall?.[2]?.detached).toBe(true);
103+expect(spawnCall?.[2]?.stdio).toBe("ignore");
104+expect(spawnCall?.[2]?.windowsHide).toBe(true);
110105expect(unref).toHaveBeenCalledOnce();
111106112107const scriptPath = [...createdScriptPaths][0];
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。