44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { listThinkingLevels, normalizeReasoningLevel, normalizeThinkLevel } from "./thinking.js";
|
|
|
|
describe("normalizeThinkLevel", () => {
|
|
it("accepts mid as medium", () => {
|
|
expect(normalizeThinkLevel("mid")).toBe("medium");
|
|
});
|
|
|
|
it("accepts xhigh", () => {
|
|
expect(normalizeThinkLevel("xhigh")).toBe("xhigh");
|
|
});
|
|
});
|
|
|
|
describe("listThinkingLevels", () => {
|
|
it("includes xhigh for codex models", () => {
|
|
expect(listThinkingLevels(undefined, "gpt-5.2-codex")).toContain("xhigh");
|
|
});
|
|
|
|
it("includes xhigh for openai gpt-5.2", () => {
|
|
expect(listThinkingLevels("openai", "gpt-5.2")).toContain("xhigh");
|
|
});
|
|
|
|
it("excludes xhigh for non-codex models", () => {
|
|
expect(listThinkingLevels(undefined, "gpt-4.1-mini")).not.toContain("xhigh");
|
|
});
|
|
});
|
|
|
|
describe("normalizeReasoningLevel", () => {
|
|
it("accepts on/off", () => {
|
|
expect(normalizeReasoningLevel("on")).toBe("on");
|
|
expect(normalizeReasoningLevel("off")).toBe("off");
|
|
});
|
|
|
|
it("accepts show/hide", () => {
|
|
expect(normalizeReasoningLevel("show")).toBe("on");
|
|
expect(normalizeReasoningLevel("hide")).toBe("off");
|
|
});
|
|
|
|
it("accepts stream", () => {
|
|
expect(normalizeReasoningLevel("stream")).toBe("stream");
|
|
expect(normalizeReasoningLevel("streaming")).toBe("stream");
|
|
});
|
|
});
|