ioredis-mock icon indicating copy to clipboard operation
ioredis-mock copied to clipboard

replyTransformer is not executed when `hgetAllBuffer()` is used.

Open ChrisKitching opened this issue 4 years ago • 1 comments

Register a reply-transformer:

IORedis.Command.setReplyTransformer("hgetall", function(result) {
    console.log("RUNNING TRANSFORMER:");
    return [42];
});

IORedis will call this when either hgetall() or hgetallBuffer() is called. ioredis-mock only does it for hgetall().

You can work around this with ioredis-mock by calling setReplyTransformer() again with "hgetallBuffer" as the string argument, but this should be unnecessary.

I have not checked, but it seems likely ioredis-mock has a similar problem for all the *Buffer() ioredis functions.

ChrisKitching avatar Jun 23 '20 17:06 ChrisKitching