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

Add tests and emit UNCERTAIN_STATE errors

This commit is contained in:
Ruben Bridgewater
2015-10-28 00:58:11 +01:00
parent 0ec2c43603
commit d39f6961e6
3 changed files with 33 additions and 3 deletions

View File

@@ -553,6 +553,19 @@ describe("The 'multi' method", function () {
});
});
it("emits error once if reconnecting after multi has been executed but not yet returned without callback", function (done) {
helper.serverVersionAtLeast.call(this, client, [2, 6, 5]);
client.on('error', function(err) {
assert.strictEqual(err.code, 'UNCERTAIN_STATE');
done();
});
client.multi().set("foo", 'bar').get('foo').exec();
// Abort connection before the value returned
client.stream.destroy();
});
});
});
});