Files
openclaw/extensions/novita/index.test.ts
Peter Steinberger f703d803cc chore(models): curate all provider model catalogs to current-generation lineups (#113681)
* chore(models): fleet-wide provider catalog curation

* fix(models): sync provider runtime catalogs and tests with curated manifests

* test(models): align venice lifecycle assertions and copilot auth default with curated catalogs

* test(models): align catalog lifecycle contract checks
2026-07-25 07:21:17 -07:00

39 lines
1.5 KiB
TypeScript

// Novita tests cover index plugin behavior.
import { registerSingleProviderPlugin } from "openclaw/plugin-sdk/plugin-test-runtime";
import { describe, expect, it } from "vitest";
import plugin from "./index.js";
function requireCatalogProvider(
result:
| { provider: { baseUrl?: string; models?: Array<{ id: string }> } }
| { providers: Record<string, unknown> }
| null
| undefined,
): { baseUrl?: string; models?: Array<{ id: string }> } {
if (!result || !("provider" in result)) {
throw new Error("single provider catalog result missing");
}
return result.provider;
}
describe("novita provider plugin", () => {
it("registers NovitaAI as an OpenAI-compatible provider", async () => {
const provider = await registerSingleProviderPlugin(plugin);
expect(provider.id).toBe("novita");
expect(provider.aliases).toEqual(["novita-ai", "novitaai"]);
expect(provider.envVars).toEqual(["NOVITA_API_KEY"]);
expect(provider.auth?.map((method) => method.id)).toEqual(["api-key"]);
expect(provider.auth?.[0]?.starterModel).toBe("novita/deepseek/deepseek-v4-pro");
const result = await provider.staticCatalog?.run({
config: {},
env: {},
resolveProviderApiKey: () => ({}),
} as never);
const catalogProvider = requireCatalogProvider(result);
expect(catalogProvider.baseUrl).toBe("https://api.novita.ai/openai/v1");
expect(catalogProvider.models?.map((model) => model.id)).toContain("deepseek/deepseek-v4-pro");
});
});