forked from faeldt/redis-mock
-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
Hi,
First, awesome work on this module!
I couldn't properly mock client.subscribe('channelName', (err, channels) => {...}) using the last argument as a callback
From redis-node: https://github.com/NodeRedis/node_redis/blob/27bb93ac19157bdc7b7958bef012e4b266d156ae/lib/individualCommands.js#L429-L435
From redis-mock: https://github.com/yeahoffline/redis-mock/blob/master/lib/pubsub.js#L23
The potential callback is not executed
something along the lines of this should do
for (var i = 0; i < arguments.length; i++) {
[...]
}
if ('function' === typeof arguments[arguments.length - 1]) {
arguments[arguments.length - 1](
null, // no error
// send back all the channel names
Array.prototype.slice.call(arguments, 0, arguments.length - 1)
);
}Metadata
Metadata
Assignees
Labels
No labels