test: dedupe doctor migration mock reads · openclaw/openclaw@870e6f0
steipete
·
2026-05-13
·
via Recent Commits to openclaw:main
File tree
src/commands/doctor/shared
| Original file line number | Diff line number | Diff line change |
|---|
@@ -41,6 +41,10 @@ beforeEach(() => {
|
41 | 41 | getBootstrapChannelPlugin.mockReset(); |
42 | 42 | }); |
43 | 43 | |
| 44 | +function firstMigrationCall() { |
| 45 | +return applyPluginDoctorCompatibilityMigrations.mock.calls[0]; |
| 46 | +} |
| 47 | + |
44 | 48 | describe("bundled channel legacy config migrations", () => { |
45 | 49 | it("prefers bundled channel doctor contract normalizers before plugin registry fallback", () => { |
46 | 50 | collectRelevantDoctorPluginIds.mockReturnValueOnce([]); |
@@ -128,7 +132,7 @@ describe("bundled channel legacy config migrations", () => {
|
128 | 132 | }); |
129 | 133 | |
130 | 134 | expect(applyPluginDoctorCompatibilityMigrations).toHaveBeenCalledOnce(); |
131 | | -const migrationCall = applyPluginDoctorCompatibilityMigrations.mock.calls.at(0); |
| 135 | +const migrationCall = firstMigrationCall(); |
132 | 136 | expect(typeof migrationCall?.[0]).toBe("object"); |
133 | 137 | expect(migrationCall?.[1]?.config).toStrictEqual({ |
134 | 138 | channels: { |
@@ -198,7 +202,7 @@ describe("bundled channel legacy config migrations", () => {
|
198 | 202 | const result = applyChannelDoctorCompatibilityMigrations(config); |
199 | 203 | |
200 | 204 | expect(applyPluginDoctorCompatibilityMigrations).toHaveBeenCalledOnce(); |
201 | | -const migrationCall = applyPluginDoctorCompatibilityMigrations.mock.calls.at(0); |
| 205 | +const migrationCall = firstMigrationCall(); |
202 | 206 | expect(typeof migrationCall?.[0]).toBe("object"); |
203 | 207 | expect(migrationCall?.[1]).toStrictEqual({ |
204 | 208 | config, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。