1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +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

@@ -107,6 +107,20 @@ describe("connection tests", function () {
});
});
it("emits error once if reconnecting after command has been executed but not yet returned without callback", function (done) {
client = redis.createClient.apply(redis.createClient, args);
client.on('error', function(err) {
assert.strictEqual(err.code, 'UNCERTAIN_STATE');
done();
});
client.on('ready', function() {
client.set("foo", 'bar');
// Abort connection before the value returned
client.stream.destroy();
});
});
});
describe("when not connected", function () {