mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-14 08:00:45 +00:00
test: clarify config validation path assertions
This commit is contained in:
@@ -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");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user