You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
Fix should_buffer return values and empty .batch and .auth return value being sync
Fix test
This commit is contained in:
@@ -32,11 +32,12 @@ describe("The 'multi' method", function () {
|
||||
});
|
||||
|
||||
it("reports an error", function (done) {
|
||||
client.multi();
|
||||
client.exec(function (err, res) {
|
||||
var multi = client.multi();
|
||||
var notBuffering = multi.exec(function (err, res) {
|
||||
assert(err.message.match(/The connection has already been closed/));
|
||||
done();
|
||||
});
|
||||
assert.strictEqual(notBuffering, false);
|
||||
});
|
||||
|
||||
it("reports an error if promisified", function () {
|
||||
@@ -51,7 +52,7 @@ describe("The 'multi' method", function () {
|
||||
|
||||
beforeEach(function (done) {
|
||||
client = redis.createClient.apply(redis.createClient, args);
|
||||
client.once("connect", function () {
|
||||
client.once("ready", function () {
|
||||
client.flushdb(function (err) {
|
||||
return done(err);
|
||||
});
|
||||
@@ -62,6 +63,16 @@ describe("The 'multi' method", function () {
|
||||
client.end();
|
||||
});
|
||||
|
||||
it("returns an empty result array", function (done) {
|
||||
var multi = client.multi();
|
||||
var notBuffering = multi.exec(function (err, res) {
|
||||
assert.strictEqual(err, null);
|
||||
assert.strictEqual(res.length, 0);
|
||||
done();
|
||||
});
|
||||
assert.strictEqual(notBuffering, true);
|
||||
});
|
||||
|
||||
it('roles back a transaction when one command in a sequence of commands fails', function (done) {
|
||||
var multi1, multi2;
|
||||
var expected = helper.serverVersionAtLeast(client, [2, 6, 5]) ? helper.isError() : function () {};
|
||||
|
Reference in New Issue
Block a user