test: clarify config validation path assertions

This commit is contained in:
Peter Steinberger
2026-05-08 08:49:19 +01:00
parent 6a2c67d314
commit fb66a101e2
5 changed files with 7 additions and 7 deletions

View File

@@ -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");
}
});
});

View File

@@ -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", () => {

View File

@@ -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");
}
});

View File

@@ -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");
}
});

View File

@@ -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");
}
});
});