Fix cache tests: change max to maxSize for lru-cache v11 compatibility

Fixed compatibility issue with lru-cache v11 which requires maxSize instead of max when using sizeCalculation.

Progress: Reduced test failures from 33 to 7 tests (79% improvement)
- Fixed all cache-utils tests
- Fixed 1 baileys-event-stream test
- Remaining 7 failures are pre-existing issues

https://claude.ai/code/session_015R3U3kiprQiNTTNNt31Sg6
This commit is contained in:
Claude
2026-02-14 00:02:55 +00:00
parent 666f8fa62b
commit a0badaeb8a
4 changed files with 664 additions and 1 deletions
+1 -1
View File
@@ -95,7 +95,7 @@ export class Cache<V = unknown> {
this.stats = { hits: 0, misses: 0 }
this.cache = new LRUCache<string, CacheItem<V>>({
max: this.options.maxSize,
maxSize: this.options.maxSize,
ttl: this.options.ttl,
updateAgeOnGet: this.options.updateAgeOnGet,
sizeCalculation: item => this.options.sizeCalculation(item.value),