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 <qa@openrouter.ai>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-02 21:04:48 -08:00 committed by GitHub
parent 4a90abdaa2
commit 8bc0a0291b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 () => {