mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-15 20:50:42 +00:00
fix(ci): restore channel typing and root-help metadata build
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { renderRootHelpText } from "./root-help.js";
|
||||
|
||||
const getPluginCliCommandDescriptorsMock = vi.fn(
|
||||
async (_config?: unknown, _env?: unknown, _loaderOptions?: unknown) => [
|
||||
{
|
||||
name: "matrix",
|
||||
description: "Matrix channel utilities",
|
||||
hasSubcommands: true,
|
||||
},
|
||||
],
|
||||
);
|
||||
|
||||
vi.mock("./core-command-descriptors.js", () => ({
|
||||
getCoreCliCommandDescriptors: () => [
|
||||
{
|
||||
@@ -24,16 +34,28 @@ vi.mock("./subcli-descriptors.js", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("../../plugins/cli.js", () => ({
|
||||
getPluginCliCommandDescriptors: async () => [
|
||||
{
|
||||
name: "matrix",
|
||||
description: "Matrix channel utilities",
|
||||
hasSubcommands: true,
|
||||
},
|
||||
],
|
||||
getPluginCliCommandDescriptors: (...args: [unknown?, unknown?, unknown?]) =>
|
||||
getPluginCliCommandDescriptorsMock(...args),
|
||||
}));
|
||||
|
||||
describe("root help", () => {
|
||||
it("passes isolated config and env through to plugin CLI descriptor loading", async () => {
|
||||
const config = {
|
||||
agents: {
|
||||
defaults: {
|
||||
workspace: "/tmp/openclaw-root-help-workspace",
|
||||
},
|
||||
},
|
||||
};
|
||||
const env = { OPENCLAW_STATE_DIR: "/tmp/openclaw-root-help-state" } as NodeJS.ProcessEnv;
|
||||
|
||||
await renderRootHelpText({ config, env, pluginSdkResolution: "src" });
|
||||
|
||||
expect(getPluginCliCommandDescriptorsMock).toHaveBeenCalledWith(config, env, {
|
||||
pluginSdkResolution: "src",
|
||||
});
|
||||
});
|
||||
|
||||
it("includes plugin CLI descriptors alongside core and sub-CLI commands", async () => {
|
||||
const text = await renderRootHelpText();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user