test: tighten acp security helpers · openclaw/openclaw@daa48e8
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -113,7 +113,9 @@ async function createHarness(
|
113 | 113 | const promptPromise = promptAgent(agent, SESSION_ID); |
114 | 114 | |
115 | 115 | await vi.waitFor(() => { |
116 | | -expect(runId).toBeDefined(); |
| 116 | +if (!runId) { |
| 117 | +throw new Error("expected ACP permission relay run id"); |
| 118 | +} |
117 | 119 | }); |
118 | 120 | |
119 | 121 | return { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,6 @@ function requireFinding(
|
27 | 27 | label: string, |
28 | 28 | ) { |
29 | 29 | const finding = findings.find((entry) => entry.checkId === checkId); |
30 | | -expect(finding, label).toBeDefined(); |
31 | 30 | if (!finding) { |
32 | 31 | throw new Error(`Expected ${checkId} finding for ${label}`); |
33 | 32 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -123,7 +123,6 @@ describe("security fix", () => {
|
123 | 123 | const whatsapp = channels.whatsapp; |
124 | 124 | const accounts = whatsapp.accounts as Record<string, Record<string, unknown>>; |
125 | 125 | const account = accounts[accountId]; |
126 | | -expect(account).toBeDefined(); |
127 | 126 | if (!account) { |
128 | 127 | throw new Error(`Expected WhatsApp account ${accountId}`); |
129 | 128 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -88,7 +88,6 @@ function expectInspectSuccess(
|
88 | 88 | function expectIcaclsResetCommand( |
89 | 89 | result: ReturnType<typeof createIcaclsResetCommand>, |
90 | 90 | ): NonNullable<ReturnType<typeof createIcaclsResetCommand>> { |
91 | | -expect(result).toBeDefined(); |
92 | 91 | if (!result) { |
93 | 92 | throw new Error("Expected icacls reset command"); |
94 | 93 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。