Redis.Cluster.mockImplementation(() => { let onCallbacks = {}; return { on: jest.fn((event, cb) => onCallbacks[event] = cb), disconnect: jest.fn(), subscribe: jest.fn(), publish: jest.fn(), onCallbacks }; });
/** * Subscribe to a command * * @param {String} cmd * @param {String} nodeID * * @memberof RedisTransporter */ subscribe(cmd, nodeID) { this.clientSub.subscribe(this.getTopicName(cmd, nodeID)); return this.broker.Promise.resolve(); }
async delCache(key: string) { return await this.client.del(key); }
Redis.mockImplementation(() => { let onCallbacks = {}; return { on: jest.fn((event, cb) => onCallbacks[event] = cb), disconnect: jest.fn(), subscribe: jest.fn(), publish: jest.fn(), onCallbacks }; });