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

feat: implement nodes method in cluster mock #1260

Merged
merged 4 commits into from
Mar 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove typescript syntax
  • Loading branch information
egmzy authored Mar 28, 2023
commit 22e0738e4a01eff9d94d7b3d00ae3f14cfc6d58b
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ RedisMock.Cluster = class RedisClusterMock extends RedisMock {
nodesOptions.forEach(options => this.nodes.all.push(new RedisMock(options)))
}

private this.nodes = {
nodes = {
all: [],
master: [],
slave: [],
};

public nodes(role = "all") {
nodes(role = "all") {
if (role !== "all" && role !== "master" && role !== "slave") {
throw new Error(`Invalid role "${role}". Expected "all", "master" or "slave"`);
}
Expand Down