feat: refine providers onboarding and cli
This commit is contained in:
29
src/providers/registry.test.ts
Normal file
29
src/providers/registry.test.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
formatProviderSelectionLine,
|
||||
listChatProviders,
|
||||
normalizeChatProviderId,
|
||||
} from "./registry.js";
|
||||
|
||||
describe("provider registry", () => {
|
||||
it("normalizes aliases", () => {
|
||||
expect(normalizeChatProviderId("imsg")).toBe("imessage");
|
||||
});
|
||||
|
||||
it("keeps Telegram first in the default order", () => {
|
||||
const providers = listChatProviders();
|
||||
expect(providers[0]?.id).toBe("telegram");
|
||||
});
|
||||
|
||||
it("formats selection lines with docs labels", () => {
|
||||
const providers = listChatProviders();
|
||||
const first = providers[0];
|
||||
if (!first) throw new Error("Missing provider metadata.");
|
||||
const line = formatProviderSelectionLine(first, (path, label) =>
|
||||
[label, path].filter(Boolean).join(":"),
|
||||
);
|
||||
expect(line).toContain("Docs:");
|
||||
expect(line).toContain("telegram");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user