From 3d64fcaf1f2a5c69ec8b4f4cb476027862e2aabb Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sat, 2 May 2026 18:55:27 -0700 Subject: [PATCH] test(plugins): align persisted registry snapshot assertion --- src/plugins/plugin-registry-snapshot.test.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugins/plugin-registry-snapshot.test.ts b/src/plugins/plugin-registry-snapshot.test.ts index f0800d2633d..5f3087f62f5 100644 --- a/src/plugins/plugin-registry-snapshot.test.ts +++ b/src/plugins/plugin-registry-snapshot.test.ts @@ -96,7 +96,7 @@ describe("loadPluginRegistrySnapshotWithMetadata", () => { expect(result.diagnostics).toEqual([]); }); - it("keeps persisted package plugins on the fast path when file signatures match", () => { + it("keeps persisted package plugins when file hashes match", () => { const tempRoot = makeTempDir(); const rootDir = path.join(tempRoot, "workspace"); const stateDir = path.join(tempRoot, "state"); @@ -113,19 +113,14 @@ describe("loadPluginRegistrySnapshotWithMetadata", () => { expect(record?.packageJson?.fileSignature).toBeDefined(); writePersistedInstalledPluginIndexSync(index, { stateDir }); - const readFileSyncSpy = vi.spyOn(fs, "readFileSync"); const result = loadPluginRegistrySnapshotWithMetadata({ config, env, stateDir, }); - const pluginManifestFileReads = readFileSyncSpy.mock.calls.filter((call) => { - const filePath = String(call[0]); - return filePath === path.join(rootDir, "openclaw.plugin.json"); - }); expect(result.source).toBe("persisted"); - expect(pluginManifestFileReads).toEqual([]); + expect(result.diagnostics).toEqual([]); }); it("detects same-size same-mtime manifest replacements", () => {