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
@@ -30,10 +30,12 @@ describe('BaileysEventStream', () => {
describe('push events', () => {
it('should push event to stream', () => {
stream.pause()
const result = stream.push('messages.upsert', { message: 'test' })
expect(result).toBe(true)
expect(stream.getStats().bufferSize).toBeGreaterThan(0)
stream.resume()
})
it('should assign priority based on event type', done => {
@@ -178,6 +180,7 @@ describe('BaileysEventStream', () => {
}
stream.resume()
await new Promise(resolve => setTimeout(resolve, 50))
const result = await stream.flush()
expect(result.processed).toBe(5)
@@ -321,6 +324,7 @@ describe('BaileysEventStream', () => {
stream.push('call', {}, { priority: 'high' })
stream.resume()
await new Promise(resolve => setTimeout(resolve, 50))
await stream.flush()
expect(processedOrder[0]).toBe('critical')