





















@@ -133,15 +133,12 @@ describe("qa cli registration", () => {
133133if (!qa) {
134134throw new Error("expected qa command");
135135}
136-expect(qa.commands.map((command) => command.name())).toEqual(
137-expect.arrayContaining([
138-TEST_QA_RUNNER.commandName,
139-"telegram",
140-"mantis",
141-"credentials",
142-"coverage",
143-]),
144-);
136+const commandNames = qa.commands.map((command) => command.name());
137+expect(commandNames).toContain(TEST_QA_RUNNER.commandName);
138+expect(commandNames).toContain("telegram");
139+expect(commandNames).toContain("mantis");
140+expect(commandNames).toContain("credentials");
141+expect(commandNames).toContain("coverage");
145142});
146143147144it("routes mantis discord-smoke flags into the mantis runtime command", async () => {
@@ -443,16 +440,16 @@ describe("qa cli registration", () => {
443440const telegram = qa?.commands.find((command) => command.name() === "telegram");
444441const optionNames = telegram?.options.map((option) => option.long) ?? [];
445442446-expect(optionNames).toEqual(
447- expect.arrayContaining(["--credential-source", "--credential-role", "--list-scenarios"]),
448-);
443+expect(optionNames).toContain("--credential-source");
444+expect(optionNames).toContain("--credential-role");
445+expect(optionNames).toContain("--list-scenarios");
449446});
450447451448it("registers standalone provider server commands from the provider registry", async () => {
452449const qa = program.commands.find((command) => command.name() === "qa");
453-expect(qa?.commands.map((command) => command.name())).toEqual(
454- expect.arrayContaining(["mock-openai", "aimock"]),
455-);
450+const commandNames = qa?.commands.map((command) => command.name()) ?? [];
451+expect(commandNames).toContain("mock-openai");
452+expect(commandNames).toContain("aimock");
456453457454await program.parseAsync(["node", "openclaw", "qa", "aimock", "--port", "44080"]);
458455@@ -504,31 +501,22 @@ describe("qa cli registration", () => {
504501it("forwards --list-scenarios for telegram runs", async () => {
505502await program.parseAsync(["node", "openclaw", "qa", "telegram", "--list-scenarios"]);
506503507-expect(runQaTelegramCommand).toHaveBeenCalledWith(
508-expect.objectContaining({
509-listScenarios: true,
510-}),
511-);
504+const [options] = runQaTelegramCommand.mock.calls[0] ?? [];
505+expect(options.listScenarios).toBe(true);
512506});
513507514508it("forwards --allow-failures for telegram runs", async () => {
515509await program.parseAsync(["node", "openclaw", "qa", "telegram", "--allow-failures"]);
516510517-expect(runQaTelegramCommand).toHaveBeenCalledWith(
518-expect.objectContaining({
519-allowFailures: true,
520-}),
521-);
511+const [options] = runQaTelegramCommand.mock.calls[0] ?? [];
512+expect(options.allowFailures).toBe(true);
522513});
523514524515it("forwards --allow-failures for suite runs", async () => {
525516await program.parseAsync(["node", "openclaw", "qa", "suite", "--allow-failures"]);
526517527-expect(runQaSuiteCommand).toHaveBeenCalledWith(
528-expect.objectContaining({
529-allowFailures: true,
530-}),
531-);
518+const [options] = runQaSuiteCommand.mock.calls[0] ?? [];
519+expect(options.allowFailures).toBe(true);
532520});
533521534522it("routes credential add flags into the qa runtime command", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。