(cache: PdfCache, url: string)
| 81 | const tenBytes = new Uint8Array(10); |
| 82 | |
| 83 | async function fill(cache: PdfCache, url: string): Promise<void> { |
| 84 | const m = spyOn(globalThis, "fetch").mockResolvedValueOnce( |
| 85 | new Response(tenBytes, { status: 200 }), |
| 86 | ); |
| 87 | try { |
| 88 | await cache.readPdfRange(url, 0, 1024); |
| 89 | } finally { |
| 90 | m.mockRestore(); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | it("evicts least-recently-used entry when total exceeds cap", async () => { |
| 95 | const cache = createPdfCache(25); |
no test coverage detected
searching dependent graphs…