test: wait for acp resolver by assertion · openclaw/openclaw@8c4c728
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
File tree
agents/pi-embedded-runner
| Original file line number | Diff line number | Diff line change |
|---|
@@ -331,12 +331,7 @@ describe("acp translator stop reason mapping", () => {
|
331 | 331 | await Promise.resolve(); |
332 | 332 | agent.handleGatewayDisconnect("1006: first disconnect"); |
333 | 333 | agent.handleGatewayReconnect(); |
334 | | -for (let attempt = 0; attempt < 5; attempt += 1) { |
335 | | -if (resolveAgentWait) { |
336 | | -break; |
337 | | -} |
338 | | -await Promise.resolve(); |
339 | | -} |
| 334 | +await vi.waitFor(() => expect(resolveAgentWait).toBeDefined()); |
340 | 335 | const resolveWait = requireValue(resolveAgentWait, "agent.wait resolver"); |
341 | 336 | |
342 | 337 | agent.handleGatewayDisconnect("1006: second disconnect"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -221,7 +221,9 @@ export const mockedGetApiKeyForModel = vi.fn(
|
221 | 221 | }), |
222 | 222 | ); |
223 | 223 | export const mockedEnsureAuthProfileStore = vi.fn(() => ({})); |
224 | | -export const mockedEnsureAuthProfileStoreWithoutExternalProfiles = vi.fn(() => ({})); |
| 224 | +export const mockedEnsureAuthProfileStoreWithoutExternalProfiles = vi.fn( |
| 225 | +(_agentDir?: string, _options?: { allowKeychainPrompt?: boolean }) => ({}), |
| 226 | +); |
225 | 227 | export const mockedResolveAuthProfileOrder = vi.fn(() => [] as string[]); |
226 | 228 | export const mockedMarkAuthProfileSuccess = vi.fn(async () => {}); |
227 | 229 | export const mockedShouldPreferExplicitConfigApiKeyAuth = vi.fn(() => false); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。