summaryrefslogtreecommitdiffhomepage
path: root/packages/cli/src/catalog.test.ts
blob: a6d27f2525415d95c6ec6b207ce1f6e347eff63e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { describe, expect, it } from "vitest";
import { formatCatalog } from "./catalog.js";

describe("formatCatalog", () => {
  it("formats a single model", () => {
    expect(formatCatalog({ models: ["openai/gpt-4"] })).toBe("openai/gpt-4");
  });

  it("formats multiple models one per line", () => {
    expect(formatCatalog({ models: ["openai/gpt-4", "anthropic/claude-3", "local/llama"] })).toBe(
      "openai/gpt-4\nanthropic/claude-3\nlocal/llama",
    );
  });

  it("returns empty string for empty models", () => {
    expect(formatCatalog({ models: [] })).toBe("");
  });
});