test: dedupe utility and config suites

This commit is contained in:
Peter Steinberger
2026-03-28 00:26:10 +00:00
parent d8f97358d7
commit fef688fb7a
24 changed files with 1178 additions and 1312 deletions

View File

@@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";
import { resolveReactionLevel } from "./reaction-level.js";
describe("resolveReactionLevel", () => {
const cases = [
it.each([
{
name: "defaults when value is missing",
input: {
@@ -55,11 +55,7 @@ describe("resolveReactionLevel", () => {
agentReactionGuidance: "minimal",
},
},
] as const;
for (const testCase of cases) {
it(testCase.name, () => {
expect(resolveReactionLevel(testCase.input)).toEqual(testCase.expected);
});
}
] as const)("$name", ({ input, expected }) => {
expect(resolveReactionLevel(input)).toEqual(expected);
});
});

View File

@@ -43,11 +43,7 @@ describe("parseBooleanValue", () => {
});
describe("isReasoningTagProvider", () => {
const cases: Array<{
name: string;
value: string | null | undefined;
expected: boolean;
}> = [
it.each([
{
name: "returns false for ollama - native reasoning field, no tags needed (#2279)",
value: "ollama",
@@ -82,13 +78,13 @@ describe("isReasoningTagProvider", () => {
{ name: "returns false for anthropic", value: "anthropic", expected: false },
{ name: "returns false for openai", value: "openai", expected: false },
{ name: "returns false for openrouter", value: "openrouter", expected: false },
];
for (const testCase of cases) {
it(testCase.name, () => {
expect(isReasoningTagProvider(testCase.value)).toBe(testCase.expected);
});
}
] satisfies Array<{
name: string;
value: string | null | undefined;
expected: boolean;
}>)("$name", ({ value, expected }) => {
expect(isReasoningTagProvider(value)).toBe(expected);
});
});
describe("splitShellArgs", () => {