1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Add test. Closes #909

This commit is contained in:
Ruben Bridgewater
2015-10-29 23:49:10 +01:00
parent 1293046bab
commit b7a0f6f905
2 changed files with 13 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ Features
- The `drain` event is from now on only emitted if the stream really had to buffer - 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)) - 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)) - 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 Bugfixes

View File

@@ -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 () { it("works with missing options object for new redis instances", function () {
// This is needed for libraries that have their own createClient function like fakeredis // This is needed for libraries that have their own createClient function like fakeredis
client = new redis.RedisClient({ on: function () {}}); client = new redis.RedisClient({ on: function () {}});