mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:50:43 +00:00
test: isolate legacy auth choice aliases
This commit is contained in:
@@ -1,4 +1,30 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
const manifestAuthChoices = vi.hoisted(() => [
|
||||
{
|
||||
pluginId: "anthropic",
|
||||
providerId: "anthropic",
|
||||
methodId: "cli",
|
||||
choiceId: "anthropic-cli",
|
||||
choiceLabel: "Anthropic Claude CLI",
|
||||
deprecatedChoiceIds: ["claude-cli"],
|
||||
},
|
||||
{
|
||||
pluginId: "openai",
|
||||
providerId: "openai-codex",
|
||||
methodId: "cli",
|
||||
choiceId: "openai-codex-cli",
|
||||
choiceLabel: "OpenAI Codex CLI",
|
||||
deprecatedChoiceIds: ["codex-cli"],
|
||||
},
|
||||
]);
|
||||
|
||||
vi.mock("../plugins/provider-auth-choices.js", () => ({
|
||||
resolveManifestProviderAuthChoices: () => manifestAuthChoices,
|
||||
resolveManifestDeprecatedProviderAuthChoice: (choiceId: string) =>
|
||||
manifestAuthChoices.find((choice) => choice.deprecatedChoiceIds.includes(choiceId)),
|
||||
}));
|
||||
|
||||
import {
|
||||
resolveLegacyAuthChoiceAliasesForCli,
|
||||
formatDeprecatedNonInteractiveAuthChoiceError,
|
||||
|
||||
Reference in New Issue
Block a user