mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-01 20:31:19 +00:00
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { DEFAULT_GOOGLE_API_BASE_URL, normalizeGoogleApiBaseUrl } from "./google-api-base-url.js";
|
|
|
|
describe("normalizeGoogleApiBaseUrl", () => {
|
|
it("defaults to the Gemini v1beta API root", () => {
|
|
expect(normalizeGoogleApiBaseUrl()).toBe(DEFAULT_GOOGLE_API_BASE_URL);
|
|
});
|
|
|
|
it.each([
|
|
{
|
|
value: "https://generativelanguage.googleapis.com",
|
|
expected: DEFAULT_GOOGLE_API_BASE_URL,
|
|
},
|
|
{
|
|
value: "https://generativelanguage.googleapis.com/",
|
|
expected: DEFAULT_GOOGLE_API_BASE_URL,
|
|
},
|
|
{
|
|
value: "https://generativelanguage.googleapis.com/v1beta",
|
|
expected: DEFAULT_GOOGLE_API_BASE_URL,
|
|
},
|
|
{
|
|
value: "https://generativelanguage.googleapis.com/v1",
|
|
expected: "https://generativelanguage.googleapis.com/v1",
|
|
},
|
|
{
|
|
value: "https://proxy.example.com/google/v1beta/",
|
|
expected: "https://proxy.example.com/google/v1beta",
|
|
},
|
|
])("normalizes %s", ({ value, expected }) => {
|
|
expect(normalizeGoogleApiBaseUrl(value)).toBe(expected);
|
|
});
|
|
});
|