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