test: tighten sandbox docker audit assertions · openclaw/openclaw@db81936
steipete
·
2026-05-10
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -173,12 +173,15 @@ describe("security audit sandbox docker config", () => {
|
173 | 173 | ...collectSandboxDockerNoopFindings(testCase.cfg), |
174 | 174 | ...collectSandboxDangerousConfigFindings(testCase.cfg), |
175 | 175 | ]; |
176 | | -if (testCase.expectedFindings.length > 0) { |
177 | | -expect(findings, testCase.name).toEqual( |
178 | | -expect.arrayContaining( |
179 | | -testCase.expectedFindings.map((finding) => expect.objectContaining(finding)), |
180 | | -), |
181 | | -); |
| 176 | +for (const expectedFinding of testCase.expectedFindings) { |
| 177 | +const finding = findings.find((entry) => entry.checkId === expectedFinding.checkId); |
| 178 | +expect(finding?.checkId, testCase.name).toBe(expectedFinding.checkId); |
| 179 | +if ("severity" in expectedFinding) { |
| 180 | +expect(finding?.severity, testCase.name).toBe(expectedFinding.severity); |
| 181 | +} |
| 182 | +if ("title" in expectedFinding) { |
| 183 | +expect(finding?.title, testCase.name).toBe(expectedFinding.title); |
| 184 | +} |
182 | 185 | } |
183 | 186 | expectFindingSet({ |
184 | 187 | findings, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。