Files
openclaw/src/entry.run-main.test.ts
Vincent Koc 3b3a64c322 fix(cli): keep JSON stdout valid through finalization (#115315)
* fix(cli): preserve JSON stdout through finalization

* test(cli): cover JSON entrypoint routing

* fix(cli): preserve native relay import ordering
2026-07-29 14:04:12 +08:00

18 lines
581 B
TypeScript

import { describe, expect, it, vi } from "vitest";
import { runMainOrRootHelp } from "./entry.js";
describe("entry run-main boundary", () => {
it("retains JSON console routing through process finalization", async () => {
const runCli = vi.fn(async () => undefined);
await runMainOrRootHelp(["node", "openclaw", "status"], {
loadRunCli: async () => ({ runCli }),
});
expect(runCli).toHaveBeenCalledWith(["node", "openclaw", "status"], {
additionalStartupTrace: expect.any(Object),
retainConsoleRoutingUntilProcessExit: true,
});
});
});