summaryrefslogtreecommitdiffhomepage
path: root/packages/cli/src/catalog.test.ts
blob: 3b32efcdfa67410a739cdd3b444c883a210da805 (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("");
	});
});