mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 06:00:23 +00:00
* test: dedupe extension-owned coverage * test: remove duplicate coverage files * test: move helper coverage into extensions * test: trim duplicate helper assertions * test: remove cloudflare helper import from agent test * test: align stale expectations with current main
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveAnthropicVertexRegion, resolveAnthropicVertexRegionFromBaseUrl } from "./api.js";
|
|
|
|
describe("anthropic vertex region helpers", () => {
|
|
it("accepts well-formed regional env values", () => {
|
|
expect(
|
|
resolveAnthropicVertexRegion({
|
|
GOOGLE_CLOUD_LOCATION: "us-east1",
|
|
} as NodeJS.ProcessEnv),
|
|
).toBe("us-east1");
|
|
});
|
|
|
|
it("falls back to the default region for malformed env values", () => {
|
|
expect(
|
|
resolveAnthropicVertexRegion({
|
|
GOOGLE_CLOUD_LOCATION: "us-central1.attacker.example",
|
|
} as NodeJS.ProcessEnv),
|
|
).toBe("global");
|
|
});
|
|
|
|
it("parses regional Vertex endpoints", () => {
|
|
expect(
|
|
resolveAnthropicVertexRegionFromBaseUrl("https://europe-west4-aiplatform.googleapis.com"),
|
|
).toBe("europe-west4");
|
|
});
|
|
|
|
it("treats the global Vertex endpoint as global", () => {
|
|
expect(resolveAnthropicVertexRegionFromBaseUrl("https://aiplatform.googleapis.com")).toBe(
|
|
"global",
|
|
);
|
|
});
|
|
});
|