mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-01 08:10:21 +00:00
test: deduplicate cli option collision fixtures
This commit is contained in:
@@ -44,30 +44,36 @@ describe("update cli option collisions", () => {
|
||||
defaultRuntime.exit.mockClear();
|
||||
});
|
||||
|
||||
it("forwards parent-captured --json/--timeout to `update status`", async () => {
|
||||
await runRegisteredCli({
|
||||
register: registerUpdateCli as (program: Command) => void,
|
||||
it.each([
|
||||
{
|
||||
name: "forwards parent-captured --json/--timeout to `update status`",
|
||||
argv: ["update", "status", "--json", "--timeout", "9"],
|
||||
});
|
||||
|
||||
expect(updateStatusCommand).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
json: true,
|
||||
timeout: "9",
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("forwards parent-captured --timeout to `update wizard`", async () => {
|
||||
assert: () => {
|
||||
expect(updateStatusCommand).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
json: true,
|
||||
timeout: "9",
|
||||
}),
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "forwards parent-captured --timeout to `update wizard`",
|
||||
argv: ["update", "wizard", "--timeout", "13"],
|
||||
assert: () => {
|
||||
expect(updateWizardCommand).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
timeout: "13",
|
||||
}),
|
||||
);
|
||||
},
|
||||
},
|
||||
])("$name", async ({ argv, assert }) => {
|
||||
await runRegisteredCli({
|
||||
register: registerUpdateCli as (program: Command) => void,
|
||||
argv: ["update", "wizard", "--timeout", "13"],
|
||||
argv,
|
||||
});
|
||||
|
||||
expect(updateWizardCommand).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
timeout: "13",
|
||||
}),
|
||||
);
|
||||
assert();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user