Skip to content

Commit ebea087

Browse files
author
Ruben Bridgewater
committed
Add regression test
1 parent 399a29a commit ebea087

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/commands/multi.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,22 @@ describe("The 'multi' method", function () {
537537
});
538538
});
539539

540+
it("works properly after a reconnect. issue #897", function (done) {
541+
helper.serverVersionAtLeast.call(this, client, [2, 6, 5]);
542+
543+
client.stream.destroy();
544+
client.on('error', function (err) {
545+
assert.strictEqual(err.code, 'ECONNREFUSED');
546+
});
547+
client.on('ready', function () {
548+
client.multi([['set', 'foo', 'bar'], ['get', 'foo']]).exec(function (err, res) {
549+
assert(!err);
550+
assert.strictEqual(res[1], 'bar');
551+
done();
552+
});
553+
});
554+
});
555+
540556
});
541557
});
542558
});

0 commit comments

Comments
 (0)