test(plugins): align persisted registry snapshot assertion · openclaw/openclaw@3d64fca
vincentkoc
·
2026-05-03
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -96,7 +96,7 @@ describe("loadPluginRegistrySnapshotWithMetadata", () => {
|
96 | 96 | expect(result.diagnostics).toEqual([]); |
97 | 97 | }); |
98 | 98 | |
99 | | -it("keeps persisted package plugins on the fast path when file signatures match", () => { |
| 99 | +it("keeps persisted package plugins when file hashes match", () => { |
100 | 100 | const tempRoot = makeTempDir(); |
101 | 101 | const rootDir = path.join(tempRoot, "workspace"); |
102 | 102 | const stateDir = path.join(tempRoot, "state"); |
@@ -113,19 +113,14 @@ describe("loadPluginRegistrySnapshotWithMetadata", () => {
|
113 | 113 | expect(record?.packageJson?.fileSignature).toBeDefined(); |
114 | 114 | writePersistedInstalledPluginIndexSync(index, { stateDir }); |
115 | 115 | |
116 | | -const readFileSyncSpy = vi.spyOn(fs, "readFileSync"); |
117 | 116 | const result = loadPluginRegistrySnapshotWithMetadata({ |
118 | 117 | config, |
119 | 118 | env, |
120 | 119 | stateDir, |
121 | 120 | }); |
122 | | -const pluginManifestFileReads = readFileSyncSpy.mock.calls.filter((call) => { |
123 | | -const filePath = String(call[0]); |
124 | | -return filePath === path.join(rootDir, "openclaw.plugin.json"); |
125 | | -}); |
126 | 121 | |
127 | 122 | expect(result.source).toBe("persisted"); |
128 | | -expect(pluginManifestFileReads).toEqual([]); |
| 123 | +expect(result.diagnostics).toEqual([]); |
129 | 124 | }); |
130 | 125 | |
131 | 126 | it("detects same-size same-mtime manifest replacements", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。