test: isolate legacy auth choice aliases

This commit is contained in:
Peter Steinberger
2026-04-26 03:34:08 +01:00
parent 10763781fd
commit 802a73a382

View File

@@ -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,