test: clarify security scanner assertions · openclaw/openclaw@af8cf11
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -160,7 +160,9 @@ description: test skill
|
160 | 160 | await fs.writeFile(path.join(pluginDir, "index.js"), "export {};"); |
161 | 161 | |
162 | 162 | const findings = await collectPluginsCodeSafetyFindings({ stateDir: tmpDir }); |
163 | | -expect(findings.some((f) => f.checkId === "plugins.code_safety.entry_escape")).toBe(true); |
| 163 | +expect(findings.map((finding) => finding.checkId)).toContain( |
| 164 | +"plugins.code_safety.entry_escape", |
| 165 | +); |
164 | 166 | }); |
165 | 167 | |
166 | 168 | it("ignores install backup and debris dirs when scanning installed plugin roots", async () => { |
@@ -255,7 +257,9 @@ description: test skill
|
255 | 257 | await fs.writeFile(path.join(pluginDir, "index.js"), "export {};"); |
256 | 258 | |
257 | 259 | const findings = await collectPluginsCodeSafetyFindings({ stateDir: tmpDir }); |
258 | | -expect(findings.some((f) => f.checkId === "plugins.code_safety.scan_failed")).toBe(true); |
| 260 | +expect(findings.map((finding) => finding.checkId)).toContain( |
| 261 | +"plugins.code_safety.scan_failed", |
| 262 | +); |
259 | 263 | } finally { |
260 | 264 | scanSpy.mockRestore(); |
261 | 265 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。