Skip to content

Commit b007316

Browse files
committed
add tests
1 parent be0f287 commit b007316

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

docs/client-configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
## Reconnect Strategy
3131

3232
TODO: `false | number | (retries: number, cause: unknown) => number | Error`
33+
https://github.com/redis/node-redis/pull/2250
3334

3435
You can implement a custom reconnect strategy as a function:
3536

packages/client/lib/cluster/index.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ describe('Cluster', () => {
1616
);
1717
}, GLOBAL.CLUSTERS.OPEN);
1818

19+
testUtils.testWithCluster('isOpen', async cluster => {
20+
assert.equal(cluster.isOpen, true);
21+
await cluster.disconnect();
22+
assert.equal(cluster.isOpen, false);
23+
}, GLOBAL.CLUSTERS.OPEN);
24+
25+
testUtils.testWithCluster('connect should throw if already connected', async cluster => {
26+
assert.rejects(cluster.connect());
27+
}, GLOBAL.CLUSTERS.OPEN);
28+
1929
testUtils.testWithCluster('multi', async cluster => {
2030
const key = 'key';
2131
assert.deepEqual(

0 commit comments

Comments
 (0)