simplified a lot of stuff

This commit is contained in:
Boki 2025-06-26 15:34:48 -04:00
parent b845a8eade
commit 885b484a37
20 changed files with 360 additions and 1335 deletions

View file

@ -108,17 +108,15 @@ describe('RedisCache', () => {
logger: mockLogger,
};
// Setup event handler storage
mockRedis.on = mock((event: string, handler: Function) => {
mockRedis._eventCallbacks[event] = handler;
});
cache = new RedisCache(options);
// Should setup event handlers for non-shared
expect(mockRedis.on).toHaveBeenCalledWith('connect', expect.any(Function));
expect(mockRedis.on).toHaveBeenCalledWith('ready', expect.any(Function));
expect(mockRedis.on).toHaveBeenCalledWith('error', expect.any(Function));
// Should create a new connection for non-shared
expect(mockConnectionManager.getConnection).toHaveBeenCalledWith({
name: 'CACHE-SERVICE',
singleton: false,
redisConfig: options.redisConfig,
logger: mockLogger,
});
});
it('should sanitize prefix for connection name', () => {