/
Alex_Ural
/
opencode
Обзор
Документация
Войти
/
Alex_Ural
/
opencode
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
packages/core/test/model.test.ts
23 строки
831 B
Dax
feat(core): add location-scoped config loading (#29625)
30 май 2026, 07:06
Не верифицирован
30 май 2026, 07:06
9583e08
Код
Авторство
О чём код?
import { describe, expect, test } from "bun:test" import { Schema } from "effect" import { ModelV2 } from "@opencode-ai/core/model" import { ProviderV2 } from "@opencode-ai/core/provider" const decode = Schema.decodeUnknownSync(ModelV2.Ref) describe("ModelV2.Ref", () => { test("accepts a model selection without a variant", () => { expect(decode({ id: "claude-sonnet", providerID: "anthropic" })).toEqual({ id: ModelV2.ID.make("claude-sonnet"), providerID: ProviderV2.ID.make("anthropic"), }) }) test("preserves an explicit model variant", () => { expect(decode({ id: "claude-sonnet", providerID: "anthropic", variant: "high" })).toEqual({ id: ModelV2.ID.make("claude-sonnet"), providerID: ProviderV2.ID.make("anthropic"), variant: ModelV2.VariantID.make("high"), }) }) })