mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 08:40:22 +00:00
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import {
|
|
resolveLegacyAuthChoiceAliasesForCli,
|
|
formatDeprecatedNonInteractiveAuthChoiceError,
|
|
normalizeLegacyOnboardAuthChoice,
|
|
resolveDeprecatedAuthChoiceReplacement,
|
|
} from "./auth-choice-legacy.js";
|
|
|
|
describe("auth choice legacy aliases", () => {
|
|
it("maps claude-cli to the new anthropic cli choice", () => {
|
|
expect(normalizeLegacyOnboardAuthChoice("claude-cli")).toBe("anthropic-cli");
|
|
expect(resolveDeprecatedAuthChoiceReplacement("claude-cli")).toEqual({
|
|
normalized: "anthropic-cli",
|
|
message: 'Auth choice "claude-cli" is deprecated; using Anthropic Claude CLI setup instead.',
|
|
});
|
|
expect(formatDeprecatedNonInteractiveAuthChoiceError("claude-cli")).toBe(
|
|
'Auth choice "claude-cli" is deprecated.\nUse "--auth-choice anthropic-cli".',
|
|
);
|
|
});
|
|
|
|
it("sources deprecated cli aliases from plugin manifests", () => {
|
|
expect(resolveLegacyAuthChoiceAliasesForCli()).toEqual([
|
|
"setup-token",
|
|
"oauth",
|
|
"claude-cli",
|
|
"codex-cli",
|
|
]);
|
|
});
|
|
});
|