From ebea0872a90925d404b8dd481f10c644108e7553 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Tue, 27 Oct 2015 00:35:31 +0100 Subject: [PATCH] Add regression test --- test/commands/multi.spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/commands/multi.spec.js b/test/commands/multi.spec.js index 624998b42d..062d14c32c 100644 --- a/test/commands/multi.spec.js +++ b/test/commands/multi.spec.js @@ -537,6 +537,22 @@ describe("The 'multi' method", function () { }); }); + it("works properly after a reconnect. issue #897", function (done) { + helper.serverVersionAtLeast.call(this, client, [2, 6, 5]); + + client.stream.destroy(); + client.on('error', function (err) { + assert.strictEqual(err.code, 'ECONNREFUSED'); + }); + client.on('ready', function () { + client.multi([['set', 'foo', 'bar'], ['get', 'foo']]).exec(function (err, res) { + assert(!err); + assert.strictEqual(res[1], 'bar'); + done(); + }); + }); + }); + }); }); });