From 8bc0a0291b882726305c7d2bd12b798467feb082 Mon Sep 17 00:00:00 2001 From: A <258483684+la14-1@users.noreply.github.com> Date: Mon, 2 Mar 2026 21:04:48 -0800 Subject: [PATCH] test: fix always-pass cache test to assert fetch was not called (#2127) The "should use disk cache when fresh" test in manifest.test.ts set up a mock fetch with a comment saying it "should not be called" but never asserted expect(global.fetch).not.toHaveBeenCalled(). The test passed whether or not the cache was actually used, providing no signal. -- qa/dedup-scanner Co-authored-by: spawn-qa-bot Co-authored-by: Claude Sonnet 4.6 --- packages/cli/src/__tests__/manifest.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/__tests__/manifest.test.ts b/packages/cli/src/__tests__/manifest.test.ts index 81b783c5..a3257676 100644 --- a/packages/cli/src/__tests__/manifest.test.ts +++ b/packages/cli/src/__tests__/manifest.test.ts @@ -132,7 +132,7 @@ describe("manifest", () => { }); writeFileSync(env.cacheFile, JSON.stringify(mockManifest)); - // Mock fetch (should not be called for fresh cache) + // Mock fetch — must NOT be called when cache is fresh global.fetch = mock(() => Promise.resolve(new Response(JSON.stringify(mockManifest)))); const manifest = await loadManifest(); @@ -140,6 +140,7 @@ describe("manifest", () => { expect(manifest).toHaveProperty("agents"); expect(manifest).toHaveProperty("clouds"); expect(manifest).toHaveProperty("matrix"); + expect(global.fetch).not.toHaveBeenCalled(); }); it("should refresh cache when forceRefresh is true", async () => {