From fb66a101e272624423c99951dee60c63cd07b121 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 8 May 2026 08:49:19 +0100 Subject: [PATCH] test: clarify config validation path assertions --- src/config/config.gateway-tailscale-bind.test.ts | 4 ++-- src/config/config.hooks-module-paths.test.ts | 2 +- src/config/config.multi-agent-agentdir-validation.test.ts | 2 +- src/config/config.tools-alsoAllow.test.ts | 4 ++-- src/config/logging-max-file-bytes.test.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/config/config.gateway-tailscale-bind.test.ts b/src/config/config.gateway-tailscale-bind.test.ts index 20eedea34c5..bffe4e996ea 100644 --- a/src/config/config.gateway-tailscale-bind.test.ts +++ b/src/config/config.gateway-tailscale-bind.test.ts @@ -41,7 +41,7 @@ describe("gateway tailscale bind validation", () => { }); expect(res.ok).toBe(false); if (!res.ok) { - expect(res.issues.some((issue) => issue.path === "gateway.bind")).toBe(true); + expect(res.issues.map((issue) => issue.path)).toContain("gateway.bind"); } }); @@ -73,7 +73,7 @@ describe("gateway tailscale bind validation", () => { }); expect(customRes.ok).toBe(false); if (!customRes.ok) { - expect(customRes.issues.some((issue) => issue.path === "gateway.bind")).toBe(true); + expect(customRes.issues.map((issue) => issue.path)).toContain("gateway.bind"); } }); }); diff --git a/src/config/config.hooks-module-paths.test.ts b/src/config/config.hooks-module-paths.test.ts index 0bd93f43761..4d1411fd67b 100644 --- a/src/config/config.hooks-module-paths.test.ts +++ b/src/config/config.hooks-module-paths.test.ts @@ -8,7 +8,7 @@ describe("config hooks module paths", () => { if (res.ok) { throw new Error("expected validation failure"); } - expect(res.issues.some((iss) => iss.path === expectedPath)).toBe(true); + expect(res.issues.map((issue) => issue.path)).toContain(expectedPath); }; it("rejects absolute hooks.mappings[].transform.module", () => { diff --git a/src/config/config.multi-agent-agentdir-validation.test.ts b/src/config/config.multi-agent-agentdir-validation.test.ts index d21af7317fe..5c721b20504 100644 --- a/src/config/config.multi-agent-agentdir-validation.test.ts +++ b/src/config/config.multi-agent-agentdir-validation.test.ts @@ -18,7 +18,7 @@ describe("multi-agent agentDir validation", () => { }); expect(res.ok).toBe(false); if (!res.ok) { - expect(res.issues.some((i) => i.path === "agents.list")).toBe(true); + expect(res.issues.map((issue) => issue.path)).toContain("agents.list"); expect(res.issues[0]?.message).toContain("Duplicate agentDir"); } }); diff --git a/src/config/config.tools-alsoAllow.test.ts b/src/config/config.tools-alsoAllow.test.ts index ac800b060c3..3dc72efbef6 100644 --- a/src/config/config.tools-alsoAllow.test.ts +++ b/src/config/config.tools-alsoAllow.test.ts @@ -14,7 +14,7 @@ describe("config: tools.alsoAllow", () => { expect(res.ok).toBe(false); if (!res.ok) { - expect(res.issues.some((i) => i.path === "tools")).toBe(true); + expect(res.issues.map((issue) => issue.path)).toContain("tools"); } }); @@ -35,7 +35,7 @@ describe("config: tools.alsoAllow", () => { expect(res.ok).toBe(false); if (!res.ok) { - expect(res.issues.some((i) => i.path.includes("agents.list"))).toBe(true); + expect(res.issues.map((issue) => issue.path)).toContain("agents.list.0.tools"); } }); diff --git a/src/config/logging-max-file-bytes.test.ts b/src/config/logging-max-file-bytes.test.ts index cb297977a43..29bd65256f3 100644 --- a/src/config/logging-max-file-bytes.test.ts +++ b/src/config/logging-max-file-bytes.test.ts @@ -19,7 +19,7 @@ describe("logging.maxFileBytes config", () => { }); expect(res.ok).toBe(false); if (!res.ok) { - expect(res.issues.some((issue) => issue.path === "logging.maxFileBytes")).toBe(true); + expect(res.issues.map((issue) => issue.path)).toContain("logging.maxFileBytes"); } }); });