fix(cli): keep root help pluginless by default · openclaw/openclaw@0c8bca4
vincentkoc
·
2026-05-10
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -import { describe, expect, it, vi } from "vitest"; |
| 1 | +import { beforeEach, describe, expect, it, vi } from "vitest"; |
2 | 2 | import { renderRootHelpText } from "./root-help.js"; |
3 | 3 | |
4 | 4 | const getPluginCliCommandDescriptorsMock = vi.fn( |
@@ -53,6 +53,10 @@ vi.mock("../../plugins/cli.js", () => ({
|
53 | 53 | })); |
54 | 54 | |
55 | 55 | describe("root help", () => { |
| 56 | +beforeEach(() => { |
| 57 | +getPluginCliCommandDescriptorsMock.mockClear(); |
| 58 | +}); |
| 59 | + |
56 | 60 | it("passes isolated config and env through to plugin CLI descriptor loading", async () => { |
57 | 61 | const config = { |
58 | 62 | agents: { |
@@ -71,11 +75,17 @@ describe("root help", () => {
|
71 | 75 | }); |
72 | 76 | |
73 | 77 | it("includes plugin CLI descriptors alongside core and sub-CLI commands", async () => { |
74 | | -const text = await renderRootHelpText(); |
| 78 | +const text = await renderRootHelpText({ includePluginDescriptors: true }); |
75 | 79 | |
76 | 80 | expect(text).toContain("status"); |
77 | 81 | expect(text).toContain("config"); |
78 | 82 | expect(text).toContain("matrix"); |
79 | 83 | expect(text).toContain("Matrix channel utilities"); |
80 | 84 | }); |
| 85 | + |
| 86 | +it("does not load plugin CLI descriptors by default", async () => { |
| 87 | +await renderRootHelpText(); |
| 88 | + |
| 89 | +expect(getPluginCliCommandDescriptorsMock).not.toHaveBeenCalled(); |
| 90 | +}); |
81 | 91 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。