


















@@ -11,10 +11,9 @@ describe("entry root help fast path", () => {
1111it("prefers precomputed root help text when available", async () => {
1212outputPrecomputedRootHelpTextMock.mockReturnValueOnce(true);
131314-const handled = tryHandleRootHelpFastPath(["node", "openclaw", "--help"], {
14+const handled = await tryHandleRootHelpFastPath(["node", "openclaw", "--help"], {
1515env: {},
1616});
17-await vi.dynamicImportSettled();
18171918expect(handled).toBe(true);
2019expect(outputPrecomputedRootHelpTextMock).toHaveBeenCalledTimes(1);
@@ -23,20 +22,19 @@ describe("entry root help fast path", () => {
2322it("renders root help without importing the full program", async () => {
2423const outputRootHelpMock = vi.fn();
252426-const handled = tryHandleRootHelpFastPath(["node", "openclaw", "--help"], {
25+const handled = await tryHandleRootHelpFastPath(["node", "openclaw", "--help"], {
2726outputRootHelp: outputRootHelpMock,
2827env: {},
2928});
30-await Promise.resolve();
31293230expect(handled).toBe(true);
3331expect(outputRootHelpMock).toHaveBeenCalledTimes(1);
3432});
353336-it("ignores non-root help invocations", () => {
34+it("ignores non-root help invocations", async () => {
3735const outputRootHelpMock = vi.fn();
383639-const handled = tryHandleRootHelpFastPath(["node", "openclaw", "status", "--help"], {
37+const handled = await tryHandleRootHelpFastPath(["node", "openclaw", "status", "--help"], {
4038outputRootHelp: outputRootHelpMock,
4139env: {},
4240});
@@ -45,10 +43,10 @@ describe("entry root help fast path", () => {
4543expect(outputRootHelpMock).not.toHaveBeenCalled();
4644});
474548-it("skips the host help fast path when a container target is active", () => {
46+it("skips the host help fast path when a container target is active", async () => {
4947const outputRootHelpMock = vi.fn();
504851-const handled = tryHandleRootHelpFastPath(
49+const handled = await tryHandleRootHelpFastPath(
5250["node", "openclaw", "--container", "demo", "--help"],
5351{
5452outputRootHelp: outputRootHelpMock,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。