Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline (Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/* packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
24 lines
1010 B
TypeScript
24 lines
1010 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveDeploymentModel } from "./deployment-model.js";
|
|
|
|
describe("resolveDeploymentModel", () => {
|
|
it("pairs the deployment model key with the provider it belongs to", () => {
|
|
const both = { OPENROUTER_API_KEY: "or-key", ANTHROPIC_API_KEY: "sk-ant-key" };
|
|
expect(resolveDeploymentModel(both)).toEqual({
|
|
provider: "openrouter",
|
|
model: "openai/gpt-5.6-luna",
|
|
key: "or-key",
|
|
});
|
|
// The whole point: switching the provider switches the key with it.
|
|
expect(resolveDeploymentModel({ ...both, PI_DEFAULT_PROVIDER: "anthropic" })).toEqual({
|
|
provider: "anthropic",
|
|
model: "claude-sonnet-5",
|
|
key: "sk-ant-key",
|
|
});
|
|
// A provider with no key configured yields no key — never another vendor's.
|
|
expect(
|
|
resolveDeploymentModel({ OPENROUTER_API_KEY: "or-key", PI_DEFAULT_PROVIDER: "anthropic" }),
|
|
).toEqual({ provider: "anthropic", model: "claude-sonnet-5", key: undefined });
|
|
});
|
|
});
|