Files
openclaw/extensions/gmi/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.4 KiB
TypeScript

// Gmi 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("gmi provider plugin", () => {
it("registers GMI Cloud as an OpenAI-compatible provider", async () => {
const provider = await registerSingleProviderPlugin(plugin);
expect(provider.id).toBe("gmi");
expect(provider.aliases).toEqual(["gmi-cloud", "gmicloud"]);
expect(provider.envVars).toEqual(["GMI_API_KEY"]);
expect(provider.auth?.map((method) => method.id)).toEqual(["api-key"]);
expect(provider.auth?.[0]?.starterModel).toBe("gmi/openai/gpt-5.6-sol");
const result = await provider.staticCatalog?.run({
config: {},
env: {},
resolveProviderApiKey: () => ({}),
} as never);
const catalogProvider = requireCatalogProvider(result);
expect(catalogProvider.baseUrl).toBe("https://api.gmi-serving.com/v1");
expect(catalogProvider.models?.map((model) => model.id)).toContain("openai/gpt-5.6-sol");
});
});