You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Add test. Closes #909
This commit is contained in:
@@ -15,6 +15,7 @@ Features
|
||||
- The `drain` event is from now on only emitted if the stream really had to buffer
|
||||
- Reduced the default connect_timeout to be one hour instead of 24h ([@BridgeAR](https://github.com/BridgeAR))
|
||||
- Added .path to redis.createClient(options); ([@BridgeAR](https://github.com/BridgeAR))
|
||||
- Ignore info command, if not available on server ([@ivanB1975](https://github.com/ivanB1975))
|
||||
|
||||
Bugfixes
|
||||
|
||||
|
@@ -266,6 +266,18 @@ describe("connection tests", function () {
|
||||
});
|
||||
});
|
||||
|
||||
it("connects correctly even if the info command is not present on the redis server", function (done) {
|
||||
client = redis.createClient.apply(redis.createClient, args);
|
||||
client.info = function (cb) {
|
||||
// Mock the result
|
||||
cb(new Error("ERR unknown command 'info'"));
|
||||
};
|
||||
client.once("ready", function () {
|
||||
assert.strictEqual(Object.keys(client.server_info).length, 0);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it("works with missing options object for new redis instances", function () {
|
||||
// This is needed for libraries that have their own createClient function like fakeredis
|
||||
client = new redis.RedisClient({ on: function () {}});
|
||||
|
Reference in New Issue
Block a user