mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 01:29:56 +00:00
* refactor(test): simplify GMI and Novita catalog assertions * test: keep native report process inspection real
25 lines
1.1 KiB
TypeScript
25 lines
1.1 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";
|
|
|
|
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 = result && "provider" in result ? result.provider : undefined;
|
|
expect(catalogProvider?.baseUrl).toBe("https://api.gmi-serving.com/v1");
|
|
expect(catalogProvider?.models?.map((model) => model.id)).toContain("openai/gpt-5.6-sol");
|
|
});
|
|
});
|