Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sadd method does not work when adding a single member to a set #185

Open
EvanPlettGML opened this issue Mar 29, 2021 · 1 comment
Open

Comments

@EvanPlettGML
Copy link

This line:

if (arguments.length <= 2) {

prevents sad from 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
Copy link
Author

Suggestion: change line 11 to
if (arguments.length < 2) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant