test: tighten provider env metadata assertion · openclaw/openclaw@b3aea2e
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -63,6 +63,15 @@ const pluginRegistryMocks = vi.hoisted(() => {
|
63 | 63 | }; |
64 | 64 | }); |
65 | 65 | |
| 66 | +function requireLastMetadataSnapshotCall(): unknown[] { |
| 67 | +const call = pluginRegistryMocks.loadPluginMetadataSnapshot.mock.calls.at(-1); |
| 68 | +expect(call).toBeDefined(); |
| 69 | +if (!call) { |
| 70 | +throw new Error("expected plugin metadata snapshot call"); |
| 71 | +} |
| 72 | +return call; |
| 73 | +} |
| 74 | + |
66 | 75 | vi.mock("../plugins/current-plugin-metadata-snapshot.js", () => ({ |
67 | 76 | getCurrentPluginMetadataSnapshot: pluginRegistryMocks.getCurrentPluginMetadataSnapshot, |
68 | 77 | })); |
@@ -180,7 +189,7 @@ describe("provider env vars dynamic manifest metadata", () => {
|
180 | 189 | source: "external cloud credentials", |
181 | 190 | }, |
182 | 191 | ]); |
183 | | -expect(pluginRegistryMocks.loadPluginMetadataSnapshot.mock.calls.at(-1)?.[0]).toMatchObject({ |
| 192 | +expect(requireLastMetadataSnapshotCall()[0]).toMatchObject({ |
184 | 193 | preferPersisted: false, |
185 | 194 | }); |
186 | 195 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。