mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:40:44 +00:00
test: align provider contract aliases
This commit is contained in:
@@ -53,7 +53,7 @@ export const pluginRegistrationContractCases = {
|
||||
},
|
||||
google: {
|
||||
pluginId: "google",
|
||||
providerIds: ["google", "google-gemini-cli"],
|
||||
providerIds: ["google", "google-gemini-cli", "google-vertex"],
|
||||
webSearchProviderIds: ["gemini"],
|
||||
realtimeVoiceProviderIds: ["google"],
|
||||
speechProviderIds: ["google"],
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
pluginRegistrationContractRegistry,
|
||||
providerContractLoadError,
|
||||
resolveProviderContractProvidersForPluginIds,
|
||||
} from "../../../src/plugins/contracts/registry.js";
|
||||
@@ -20,9 +19,6 @@ function resolveProviderContractProvidersFromPublicArtifact(
|
||||
}
|
||||
|
||||
export function describeProviderContracts(pluginId: string) {
|
||||
const providerIds =
|
||||
pluginRegistrationContractRegistry.find((entry) => entry.pluginId === pluginId)?.providerIds ??
|
||||
[];
|
||||
const resolveProviderEntries = (): ProviderContractEntry[] => {
|
||||
const publicArtifactProviders = resolveProviderContractProvidersFromPublicArtifact(pluginId);
|
||||
if (publicArtifactProviders) {
|
||||
@@ -33,6 +29,8 @@ export function describeProviderContracts(pluginId: string) {
|
||||
provider,
|
||||
}));
|
||||
};
|
||||
const resolveProviderIds = (): string[] =>
|
||||
resolveProviderEntries().map((entry) => entry.provider.id);
|
||||
|
||||
describe(`${pluginId} provider contract registry load`, () => {
|
||||
it("loads bundled providers without import-time registry failure", () => {
|
||||
@@ -42,7 +40,7 @@ export function describeProviderContracts(pluginId: string) {
|
||||
});
|
||||
});
|
||||
|
||||
for (const providerId of providerIds) {
|
||||
for (const providerId of resolveProviderIds()) {
|
||||
describe(`${pluginId}:${providerId} provider contract`, () => {
|
||||
// Resolve provider entries lazily so the non-isolated extension runner
|
||||
// does not race provider contract collection against other file imports.
|
||||
|
||||
Reference in New Issue
Block a user