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

Increase the coverage by adding tests and fix a failing ready check

This commit is contained in:
Ruben Bridgewater
2015-09-21 02:38:27 +02:00
parent 6975b0723d
commit 6958c1854b
5 changed files with 79 additions and 44 deletions

View File

@@ -829,17 +829,18 @@ describe("The node_redis client", function () {
var cb = function(err, reply) {
assert.equal(err.code, 'CONNECTION_BROKEN');
};
for (var i = 0; i < 10; i += 2) {
multi.set("foo" + i, "bar" + i);
for (var i = 0; i < 12; i += 3) {
client.set("foo" + i, "bar" + i);
multi.set("foo" + (i + 1), "bar" + (i + 1), cb);
multi.set("foo" + (i + 2), "bar" + (i + 2));
}
multi.exec();
assert.equal(client.command_queue.length, 13);
assert.equal(client.command_queue.length, 15);
helper.killConnection(client);
});
client.on("reconnecting", function (params) {
assert.equal(client.command_queue.length, 13);
assert.equal(client.command_queue.length, 15);
});
client.on('error', function(err) {