mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-19 08:01:17 +00:00
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:
parent
4a90abdaa2
commit
8bc0a0291b
1 changed files with 2 additions and 1 deletions
|
|
@ -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 () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue