test: consolidate redundant suites and speed up timers

This commit is contained in:
Peter Steinberger
2026-02-23 04:44:42 +00:00
parent a6a2a9276e
commit 86a8b65e9d
10 changed files with 171 additions and 224 deletions

View File

@@ -1,5 +1,6 @@
import type { Api, Model } from "@mariozechner/pi-ai";
import { describe, expect, it } from "vitest";
import { isModernModelRef } from "./live-model-filter.js";
import { normalizeModelCompat } from "./model-compat.js";
const baseModel = (): Model<Api> =>
@@ -46,3 +47,15 @@ describe("normalizeModelCompat", () => {
).toBe(false);
});
});
describe("isModernModelRef", () => {
it("excludes opencode minimax variants from modern selection", () => {
expect(isModernModelRef({ provider: "opencode", id: "minimax-m2.1" })).toBe(false);
expect(isModernModelRef({ provider: "opencode", id: "minimax-m2.5" })).toBe(false);
});
it("keeps non-minimax opencode modern models", () => {
expect(isModernModelRef({ provider: "opencode", id: "claude-opus-4-6" })).toBe(true);
expect(isModernModelRef({ provider: "opencode", id: "gemini-3-pro" })).toBe(true);
});
});