1
0
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:
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

@@ -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 () {}});