import { vi } from 'vitest' vi.doMock('lru-cache', async (importOriginal) => { const mod = await importOriginal() class LRUCacheMock, V extends NonNullable, FC> { static caches: typeof mod.LRUCache[] = [] constructor (...args: ConstructorParameters>) { const cache = new mod.LRUCache(...args) LRUCacheMock.caches.push(cache as any) return cache } } return { ...mod, LRUCache: LRUCacheMock } })