yeahoffline / redis-mock

Node.js redis client mock
212 stars 110 forks source link

Support sadd with 2 params #141 #191

Closed posabsolute closed 4 months ago

posabsolute commented 3 years ago

https://github.com/yeahoffline/redis-mock/issues/185

Fix sadd when being called with a single member. Example code:

mockRedis = require("redis-mock").createClient();
mockRedis.sadd("setName", "member");

Since only two arguments are passed, the check on line 11 resolves to true, so the method immediately exits without adding the member to the set.

EvanPlettGML commented 3 years ago

Is there anything holding up this pull request?

Also, it probably makes sense to update the comment on the method (line 8) to say "We require at least 2 arguments"