test: clarify config validation path assertions · openclaw/openclaw@fb66a10
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -41,7 +41,7 @@ describe("gateway tailscale bind validation", () => {
|
41 | 41 | }); |
42 | 42 | expect(res.ok).toBe(false); |
43 | 43 | if (!res.ok) { |
44 | | -expect(res.issues.some((issue) => issue.path === "gateway.bind")).toBe(true); |
| 44 | +expect(res.issues.map((issue) => issue.path)).toContain("gateway.bind"); |
45 | 45 | } |
46 | 46 | }); |
47 | 47 | |
@@ -73,7 +73,7 @@ describe("gateway tailscale bind validation", () => {
|
73 | 73 | }); |
74 | 74 | expect(customRes.ok).toBe(false); |
75 | 75 | if (!customRes.ok) { |
76 | | -expect(customRes.issues.some((issue) => issue.path === "gateway.bind")).toBe(true); |
| 76 | +expect(customRes.issues.map((issue) => issue.path)).toContain("gateway.bind"); |
77 | 77 | } |
78 | 78 | }); |
79 | 79 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,7 +8,7 @@ describe("config hooks module paths", () => {
|
8 | 8 | if (res.ok) { |
9 | 9 | throw new Error("expected validation failure"); |
10 | 10 | } |
11 | | -expect(res.issues.some((iss) => iss.path === expectedPath)).toBe(true); |
| 11 | +expect(res.issues.map((issue) => issue.path)).toContain(expectedPath); |
12 | 12 | }; |
13 | 13 | |
14 | 14 | it("rejects absolute hooks.mappings[].transform.module", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,7 @@ describe("multi-agent agentDir validation", () => {
|
18 | 18 | }); |
19 | 19 | expect(res.ok).toBe(false); |
20 | 20 | if (!res.ok) { |
21 | | -expect(res.issues.some((i) => i.path === "agents.list")).toBe(true); |
| 21 | +expect(res.issues.map((issue) => issue.path)).toContain("agents.list"); |
22 | 22 | expect(res.issues[0]?.message).toContain("Duplicate agentDir"); |
23 | 23 | } |
24 | 24 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ describe("config: tools.alsoAllow", () => {
|
14 | 14 | |
15 | 15 | expect(res.ok).toBe(false); |
16 | 16 | if (!res.ok) { |
17 | | -expect(res.issues.some((i) => i.path === "tools")).toBe(true); |
| 17 | +expect(res.issues.map((issue) => issue.path)).toContain("tools"); |
18 | 18 | } |
19 | 19 | }); |
20 | 20 | |
@@ -35,7 +35,7 @@ describe("config: tools.alsoAllow", () => {
|
35 | 35 | |
36 | 36 | expect(res.ok).toBe(false); |
37 | 37 | if (!res.ok) { |
38 | | -expect(res.issues.some((i) => i.path.includes("agents.list"))).toBe(true); |
| 38 | +expect(res.issues.map((issue) => issue.path)).toContain("agents.list.0.tools"); |
39 | 39 | } |
40 | 40 | }); |
41 | 41 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -19,7 +19,7 @@ describe("logging.maxFileBytes config", () => {
|
19 | 19 | }); |
20 | 20 | expect(res.ok).toBe(false); |
21 | 21 | if (!res.ok) { |
22 | | -expect(res.issues.some((issue) => issue.path === "logging.maxFileBytes")).toBe(true); |
| 22 | +expect(res.issues.map((issue) => issue.path)).toContain("logging.maxFileBytes"); |
23 | 23 | } |
24 | 24 | }); |
25 | 25 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。