Skip to content

Commit b7a0f6f

Browse files
author
Ruben Bridgewater
committed
Add test. Closes #909
1 parent 1293046 commit b7a0f6f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Features
1515
- The `drain` event is from now on only emitted if the stream really had to buffer
1616
- Reduced the default connect_timeout to be one hour instead of 24h ([@BridgeAR](https://github.com/BridgeAR))
1717
- Added .path to redis.createClient(options); ([@BridgeAR](https://github.com/BridgeAR))
18+
- Ignore info command, if not available on server ([@ivanB1975](https://github.com/ivanB1975))
1819

1920
Bugfixes
2021

test/connection.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,18 @@ describe("connection tests", function () {
266266
});
267267
});
268268

269+
it("connects correctly even if the info command is not present on the redis server", function (done) {
270+
client = redis.createClient.apply(redis.createClient, args);
271+
client.info = function (cb) {
272+
// Mock the result
273+
cb(new Error("ERR unknown command 'info'"));
274+
};
275+
client.once("ready", function () {
276+
assert.strictEqual(Object.keys(client.server_info).length, 0);
277+
done();
278+
});
279+
});
280+
269281
it("works with missing options object for new redis instances", function () {
270282
// This is needed for libraries that have their own createClient function like fakeredis
271283
client = new redis.RedisClient({ on: function () {}});

0 commit comments

Comments
 (0)