

















@@ -101,15 +101,12 @@ function expectStartupFallbackSpawn() {
101101}
102102const [executable, args, options] = lastCall;
103103expect(executable).not.toBe("cmd.exe");
104-expect(args).toEqual(expect.arrayContaining(["--port", "18789"]));
105-expect(options).toEqual(
106-expect.objectContaining({
107-detached: true,
108-env: expect.objectContaining({ OPENCLAW_GATEWAY_PORT: "18789" }),
109-stdio: "ignore",
110-windowsHide: true,
111-}),
112-);
104+expect(args).toContain("--port");
105+expect(args).toContain("18789");
106+expect(options.detached).toBe(true);
107+expect((options.env as Record<string, string> | undefined)?.OPENCLAW_GATEWAY_PORT).toBe("18789");
108+expect(options.stdio).toBe("ignore");
109+expect(options.windowsHide).toBe(true);
113110}
114111115112function expectGatewayTermination(pid: number) {
@@ -346,12 +343,11 @@ describe("Windows startup fallback", () => {
346343{ code: 0, stdout: notYetRunTaskQueryOutput(), stderr: "" },
347344);
348345349-await expect(readScheduledTaskRuntime(env)).resolves.toMatchObject({
350-status: "running",
351-pid: 4242,
352-state: "Ready",
353-lastRunResult: "267011",
354-});
346+const runtime = await readScheduledTaskRuntime(env);
347+expect(runtime.status).toBe("running");
348+expect(runtime.pid).toBe(4242);
349+expect(runtime.state).toBe("Ready");
350+expect(runtime.lastRunResult).toBe("267011");
355351});
356352});
357353@@ -369,11 +365,10 @@ describe("Windows startup fallback", () => {
369365{ code: 0, stdout: notYetRunTaskQueryOutput(), stderr: "" },
370366);
371367372-await expect(readScheduledTaskRuntime(env)).resolves.toMatchObject({
373-status: "stopped",
374-state: "Ready",
375-lastRunResult: "267011",
376-});
368+const runtime = await readScheduledTaskRuntime(env);
369+expect(runtime.status).toBe("stopped");
370+expect(runtime.state).toBe("Ready");
371+expect(runtime.lastRunResult).toBe("267011");
377372});
378373});
379374@@ -397,10 +392,9 @@ describe("Windows startup fallback", () => {
397392hints: [],
398393});
399394400-await expect(readScheduledTaskRuntime(env)).resolves.toMatchObject({
401-status: "running",
402-pid: 4242,
403-});
395+const runtime = await readScheduledTaskRuntime(env);
396+expect(runtime.status).toBe("running");
397+expect(runtime.pid).toBe(4242);
404398});
405399});
406400此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。