I have following code ::redis.set(redisKey, JSON.stringify(data), "PX", 24 * 60 * 60 * 1000, function (err) {if(err) {util.log("[BrandAggregation] Error while saving brands data in redisKey = ", redisKey, ". Error :: ",err);};cb();})Basically I want to stub this set function using sinon in such way that If this function gets called then instead of actually calling redis client it calls a dummy function which stores the data in a local variable. Is this possible?
Submitted March 24, 2020 at 06:04AM by GhostFoxGod
No comments:
Post a Comment