test: make doctor migration assertion order independent · openclaw/openclaw@5605b31
steipete
·
2026-04-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -126,7 +126,15 @@ describe("doctor command", () => {
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
129 | | -const written = writeConfigFile.mock.calls.at(-1)?.[0] as Record<string, unknown>; |
| 129 | +const written = writeConfigFile.mock.calls |
| 130 | +.map((call) => call[0] as Record<string, unknown>) |
| 131 | +.find((candidate) => { |
| 132 | +const auth = candidate.auth as { profiles?: unknown } | undefined; |
| 133 | +return Boolean(auth?.profiles); |
| 134 | +}); |
| 135 | +if (!written) { |
| 136 | +throw new Error("Expected doctor to write migrated auth profiles"); |
| 137 | +} |
130 | 138 | const profiles = (written.auth as { profiles: Record<string, unknown> }).profiles; |
131 | 139 | expect(profiles["anthropic:me@example.com"]).toBeTruthy(); |
132 | 140 | expect(profiles["anthropic:default"]).toBeUndefined(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。