1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Fix forgotten optional info section

Fixes #1003
This commit is contained in:
Ruben Bridgewater
2016-03-15 09:59:09 +01:00
parent 093f437fac
commit 24e7486a5a
2 changed files with 24 additions and 2 deletions

View File

@@ -37,6 +37,22 @@ describe("The 'info' method", function () {
}, 150);
});
it("works with optional section provided with and without callback", function (done) {
client.set('foo', 'bar');
client.info('keyspace');
client.select(2, function () {
assert.strictEqual(Object.keys(client.server_info).length, 3, 'Key length should be three');
assert(typeof client.server_info.db2 === 'object', 'db2 keyspace should be an object');
});
client.set('foo', 'bar');
client.info('all', function (err, res) {
assert(Object.keys(client.server_info).length > 3, 'Key length should be way above three');
assert.strictEqual(typeof client.server_info.redis_version, 'string');
assert.strictEqual(typeof client.server_info.db2, 'object');
done();
});
});
it("emit error after a failure", function (done) {
client.info();
client.once('error', function (err) {