You've already forked node-redis
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:
@@ -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 () {
|
||||
|
Reference in New Issue
Block a user