mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 05:59:02 +00:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -42,7 +42,7 @@ describe("registerSubCliCommands", () => {
|
||||
});
|
||||
|
||||
it("registers only the primary placeholder and dispatches", async () => {
|
||||
process.argv = ["node", "clawdbot", "acp"];
|
||||
process.argv = ["node", "moltbot", "acp"];
|
||||
const program = new Command();
|
||||
registerSubCliCommands(program, process.argv);
|
||||
|
||||
@@ -55,7 +55,7 @@ describe("registerSubCliCommands", () => {
|
||||
});
|
||||
|
||||
it("registers placeholders for all subcommands when no primary", () => {
|
||||
process.argv = ["node", "clawdbot"];
|
||||
process.argv = ["node", "moltbot"];
|
||||
const program = new Command();
|
||||
registerSubCliCommands(program, process.argv);
|
||||
|
||||
@@ -66,9 +66,9 @@ describe("registerSubCliCommands", () => {
|
||||
});
|
||||
|
||||
it("re-parses argv for lazy subcommands", async () => {
|
||||
process.argv = ["node", "clawdbot", "nodes", "list"];
|
||||
process.argv = ["node", "moltbot", "nodes", "list"];
|
||||
const program = new Command();
|
||||
program.name("clawdbot");
|
||||
program.name("moltbot");
|
||||
registerSubCliCommands(program, process.argv);
|
||||
|
||||
expect(program.commands.map((cmd) => cmd.name())).toEqual(["nodes"]);
|
||||
@@ -80,9 +80,9 @@ describe("registerSubCliCommands", () => {
|
||||
});
|
||||
|
||||
it("replaces placeholder when registering a subcommand by name", async () => {
|
||||
process.argv = ["node", "clawdbot", "acp", "--help"];
|
||||
process.argv = ["node", "moltbot", "acp", "--help"];
|
||||
const program = new Command();
|
||||
program.name("clawdbot");
|
||||
program.name("moltbot");
|
||||
registerSubCliCommands(program, process.argv);
|
||||
|
||||
await registerSubCliByName(program, "acp");
|
||||
@@ -90,7 +90,7 @@ describe("registerSubCliCommands", () => {
|
||||
const names = program.commands.map((cmd) => cmd.name());
|
||||
expect(names.filter((name) => name === "acp")).toHaveLength(1);
|
||||
|
||||
await program.parseAsync(["node", "clawdbot", "acp"], { from: "user" });
|
||||
await program.parseAsync(["node", "moltbot", "acp"], { from: "user" });
|
||||
expect(registerAcpCli).toHaveBeenCalledTimes(1);
|
||||
expect(acpAction).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user