26 lines
953 B
TypeScript
26 lines
953 B
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { OpenRouterClient } from "../openrouter";
|
|
|
|
describe("OpenRouterClient", () => {
|
|
it("should create instance with API key", () => {
|
|
const client = new OpenRouterClient("test-api-key");
|
|
expect(client).toBeInstanceOf(OpenRouterClient);
|
|
});
|
|
|
|
it("should have default free models list", () => {
|
|
const client = new OpenRouterClient("test-api-key");
|
|
const models = client.getFreeModels();
|
|
expect(models).toContain("google/gemini-2.0-flash-exp:free");
|
|
});
|
|
|
|
it("should have available model providers", () => {
|
|
const client = new OpenRouterClient("test-api-key");
|
|
const providers = client.getProviders();
|
|
expect(providers).toContain("openai");
|
|
expect(providers).toContain("google");
|
|
expect(providers).toContain("anthropic");
|
|
expect(providers).toContain("deepseek");
|
|
expect(providers).toContain("meta");
|
|
expect(providers).toContain("xai");
|
|
});
|
|
}); |