test: clarify security audit assertions · openclaw/openclaw@a8dcbb2
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -41,12 +41,12 @@ describe("security audit config symlink findings", () => {
|
41 | 41 | expect(findings).toEqual( |
42 | 42 | expect.arrayContaining([expect.objectContaining({ checkId: "fs.config.symlink" })]), |
43 | 43 | ); |
44 | | -expect(findings.some((finding) => finding.checkId === "fs.config.perms_writable")).toBe(false); |
45 | | -expect(findings.some((finding) => finding.checkId === "fs.config.perms_world_readable")).toBe( |
46 | | -false, |
47 | | -); |
48 | | -expect(findings.some((finding) => finding.checkId === "fs.config.perms_group_readable")).toBe( |
49 | | -false, |
| 44 | +expect(findings.map((finding) => finding.checkId)).not.toEqual( |
| 45 | + expect.arrayContaining([ |
| 46 | + "fs.config.perms_writable", |
| 47 | + "fs.config.perms_world_readable", |
| 48 | + "fs.config.perms_group_readable", |
| 49 | +]), |
50 | 50 | ); |
51 | 51 | }); |
52 | 52 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -82,7 +82,7 @@ describe("security audit gateway HTTP auth findings", () => {
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | if (expectedNoFinding) { |
85 | | -expect(findings.some((entry) => entry.checkId === expectedNoFinding)).toBe(false); |
| 85 | +expect(findings.map((entry) => entry.checkId)).not.toContain(expectedNoFinding); |
86 | 86 | } |
87 | 87 | }); |
88 | 88 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -70,6 +70,6 @@ describe("security audit model hygiene findings", () => {
|
70 | 70 | }, |
71 | 71 | } satisfies OpenClawConfig); |
72 | 72 | |
73 | | -expect(findings.some((finding) => finding.checkId === "models.weak_tier")).toBe(false); |
| 73 | +expect(findings.map((finding) => finding.checkId)).not.toContain("models.weak_tier"); |
74 | 74 | }); |
75 | 75 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。