simplified a lot of stuff
This commit is contained in:
parent
b845a8eade
commit
885b484a37
20 changed files with 360 additions and 1335 deletions
16
libs/core/cache/test/redis-cache.test.ts
vendored
16
libs/core/cache/test/redis-cache.test.ts
vendored
|
|
@ -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', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue