

























@@ -1,5 +1,6 @@
11import path from "node:path";
22import { afterEach, describe, expect, it, vi } from "vitest";
3+import { formatCliCommand } from "../cli/command-format.js";
34import type { RuntimeEnv } from "../runtime.js";
45import { onboardCommand, setupWizardCommand } from "./onboard.js";
56@@ -66,10 +67,10 @@ describe("setupWizardCommand", () => {
6667runtime,
6768);
686970+expect(runtime.error).toHaveBeenCalledOnce();
6971expect(runtime.error).toHaveBeenCalledWith(
70-expect.stringContaining('Invalid --secret-input-mode. Use "plaintext" or "ref", or run '),
72+`Invalid --secret-input-mode. Use "plaintext" or "ref", or run ${formatCliCommand("openclaw onboard")} for the interactive setup.`,
7173);
72-expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining("onboard"));
7374expect(runtime.exit).toHaveBeenCalledWith(1);
7475expect(mocks.runInteractiveSetup).not.toHaveBeenCalled();
7576expect(mocks.runNonInteractiveSetup).not.toHaveBeenCalled();
@@ -161,12 +162,10 @@ describe("setupWizardCommand", () => {
161162runtime,
162163);
163164165+expect(runtime.error).toHaveBeenCalledOnce();
164166expect(runtime.error).toHaveBeenCalledWith(
165-expect.stringContaining(
166-'Invalid --reset-scope. Use "config", "config+creds+sessions", or "full".',
167-),
167+`Invalid --reset-scope. Use "config", "config+creds+sessions", or "full". Run ${formatCliCommand("openclaw onboard --reset --reset-scope config")} for a config-only reset.`,
168168);
169-expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining("config-only reset"));
170169expect(runtime.exit).toHaveBeenCalledWith(1);
171170expect(mocks.handleReset).not.toHaveBeenCalled();
172171expect(mocks.runInteractiveSetup).not.toHaveBeenCalled();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。