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:
@@ -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