You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
Remove support of redis 2.4
All tests require at least redis 2.6 from now on. Anyone who wants to run the tests should be able to install a newer version.
This commit is contained in:
@@ -328,8 +328,6 @@ describe("The 'batch' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should work without any callback", function (done) {
|
it("should work without any callback", function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 6, 5]);
|
|
||||||
|
|
||||||
var batch = client.batch();
|
var batch = client.batch();
|
||||||
batch.set("baz", "binary");
|
batch.set("baz", "binary");
|
||||||
batch.set("foo", "bar");
|
batch.set("foo", "bar");
|
||||||
|
@@ -68,8 +68,6 @@ describe("The 'client' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('sets the name', function (done) {
|
it('sets the name', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 6, 9]);
|
|
||||||
|
|
||||||
// The querys are auto pipelined and the response is a response to all querys of one client
|
// The querys are auto pipelined and the response is a response to all querys of one client
|
||||||
// per chunk. So the execution order is only garanteed on each client
|
// per chunk. So the execution order is only garanteed on each client
|
||||||
var end = helper.callFuncAfter(done, 2);
|
var end = helper.callFuncAfter(done, 2);
|
||||||
|
@@ -26,32 +26,26 @@ describe("The 'eval' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('converts a float to an integer when evaluated', function (done) {
|
it('converts a float to an integer when evaluated', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.eval("return 100.5", 0, helper.isNumber(100, done));
|
client.eval("return 100.5", 0, helper.isNumber(100, done));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns a string', function (done) {
|
it('returns a string', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.eval("return 'hello world'", 0, helper.isString('hello world', done));
|
client.eval("return 'hello world'", 0, helper.isString('hello world', done));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('converts boolean true to integer 1', function (done) {
|
it('converts boolean true to integer 1', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.eval("return true", 0, helper.isNumber(1, done));
|
client.eval("return true", 0, helper.isNumber(1, done));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('converts boolean false to null', function (done) {
|
it('converts boolean false to null', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.eval("return false", 0, helper.isNull(done));
|
client.eval("return false", 0, helper.isNull(done));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('converts lua status code to string representation', function (done) {
|
it('converts lua status code to string representation', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.eval("return {ok='fine'}", 0, helper.isString('fine', done));
|
client.eval("return {ok='fine'}", 0, helper.isString('fine', done));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('converts lua error to an error response', function (done) {
|
it('converts lua error to an error response', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.eval("return {err='this is an error'}", 0, function(err) {
|
client.eval("return {err='this is an error'}", 0, function(err) {
|
||||||
assert(err.code === undefined);
|
assert(err.code === undefined);
|
||||||
helper.isError()(err);
|
helper.isError()(err);
|
||||||
@@ -60,7 +54,6 @@ describe("The 'eval' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('represents a lua table appropritely', function (done) {
|
it('represents a lua table appropritely', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.eval("return {1,2,3,'ciao',{1,2}}", 0, function (err, res) {
|
client.eval("return {1,2,3,'ciao',{1,2}}", 0, function (err, res) {
|
||||||
assert.strictEqual(5, res.length);
|
assert.strictEqual(5, res.length);
|
||||||
assert.strictEqual(1, res[0]);
|
assert.strictEqual(1, res[0]);
|
||||||
@@ -75,7 +68,6 @@ describe("The 'eval' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('populates keys and argv correctly', function (done) {
|
it('populates keys and argv correctly', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.eval("return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", 2, "a", "b", "c", "d", function (err, res) {
|
client.eval("return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", 2, "a", "b", "c", "d", function (err, res) {
|
||||||
assert.strictEqual(4, res.length);
|
assert.strictEqual(4, res.length);
|
||||||
assert.strictEqual("a", res[0]);
|
assert.strictEqual("a", res[0]);
|
||||||
@@ -87,7 +79,6 @@ describe("The 'eval' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('allows arguments to be provided in array rather than as multiple parameters', function (done) {
|
it('allows arguments to be provided in array rather than as multiple parameters', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.eval(["return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", 2, "a", "b", "c", "d"], function (err, res) {
|
client.eval(["return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", 2, "a", "b", "c", "d"], function (err, res) {
|
||||||
assert.strictEqual(4, res.length);
|
assert.strictEqual(4, res.length);
|
||||||
assert.strictEqual("a", res[0]);
|
assert.strictEqual("a", res[0]);
|
||||||
@@ -99,7 +90,6 @@ describe("The 'eval' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('allows a script to be executed that accesses the redis API without callback', function (done) {
|
it('allows a script to be executed that accesses the redis API without callback', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.eval(source, 0);
|
client.eval(source, 0);
|
||||||
client.get('sha', helper.isString('test', done));
|
client.get('sha', helper.isString('test', done));
|
||||||
});
|
});
|
||||||
@@ -108,24 +98,20 @@ describe("The 'eval' method", function () {
|
|||||||
var sha = crypto.createHash('sha1').update(source).digest('hex');
|
var sha = crypto.createHash('sha1').update(source).digest('hex');
|
||||||
|
|
||||||
it('allows a script to be executed that accesses the redis API', function (done) {
|
it('allows a script to be executed that accesses the redis API', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.eval(source, 0, helper.isString('OK'));
|
client.eval(source, 0, helper.isString('OK'));
|
||||||
client.get('sha', helper.isString('test', done));
|
client.get('sha', helper.isString('test', done));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can execute a script if the SHA exists', function (done) {
|
it('can execute a script if the SHA exists', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.evalsha(sha, 0, helper.isString('OK'));
|
client.evalsha(sha, 0, helper.isString('OK'));
|
||||||
client.get('sha', helper.isString('test', done));
|
client.get('sha', helper.isString('test', done));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns an error if SHA does not exist', function (done) {
|
it('returns an error if SHA does not exist', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.evalsha('ffffffffffffffffffffffffffffffffffffffff', 0, helper.isError(done));
|
client.evalsha('ffffffffffffffffffffffffffffffffffffffff', 0, helper.isError(done));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('emit an error if SHA does not exist without any callback', function (done) {
|
it('emit an error if SHA does not exist without any callback', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.evalsha('ffffffffffffffffffffffffffffffffffffffff', 0);
|
client.evalsha('ffffffffffffffffffffffffffffffffffffffff', 0);
|
||||||
client.on('error', function(err) {
|
client.on('error', function(err) {
|
||||||
assert.equal(err.code, 'NOSCRIPT');
|
assert.equal(err.code, 'NOSCRIPT');
|
||||||
@@ -144,7 +130,6 @@ describe("The 'eval' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('allows a key to be incremented, and performs appropriate conversion from LUA type', function (done) {
|
it('allows a key to be incremented, and performs appropriate conversion from LUA type', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.set("incr key", 0, function (err, reply) {
|
client.set("incr key", 0, function (err, reply) {
|
||||||
if (err) return done(err);
|
if (err) return done(err);
|
||||||
client.eval("local foo = redis.call('incr','incr key')\n" + "return {type(foo),foo}", 0, function (err, res) {
|
client.eval("local foo = redis.call('incr','incr key')\n" + "return {type(foo),foo}", 0, function (err, res) {
|
||||||
@@ -157,7 +142,6 @@ describe("The 'eval' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('allows a bulk operation to be performed, and performs appropriate conversion from LUA type', function (done) {
|
it('allows a bulk operation to be performed, and performs appropriate conversion from LUA type', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.set("bulk reply key", "bulk reply value", function (err, res) {
|
client.set("bulk reply key", "bulk reply value", function (err, res) {
|
||||||
client.eval("local foo = redis.call('get','bulk reply key'); return {type(foo),foo}", 0, function (err, res) {
|
client.eval("local foo = redis.call('get','bulk reply key'); return {type(foo),foo}", 0, function (err, res) {
|
||||||
assert.strictEqual(2, res.length);
|
assert.strictEqual(2, res.length);
|
||||||
@@ -169,7 +153,6 @@ describe("The 'eval' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('allows a multi mulk operation to be performed, with the appropriate type conversion', function (done) {
|
it('allows a multi mulk operation to be performed, with the appropriate type conversion', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.multi()
|
client.multi()
|
||||||
.del("mylist")
|
.del("mylist")
|
||||||
.rpush("mylist", "a")
|
.rpush("mylist", "a")
|
||||||
@@ -190,7 +173,6 @@ describe("The 'eval' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns an appropriate representation of Lua status reply', function (done) {
|
it('returns an appropriate representation of Lua status reply', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.eval("local foo = redis.call('set','mykey','myval'); return {type(foo),foo['ok']}", 0, function (err, res) {
|
client.eval("local foo = redis.call('set','mykey','myval'); return {type(foo),foo['ok']}", 0, function (err, res) {
|
||||||
assert.strictEqual(2, res.length);
|
assert.strictEqual(2, res.length);
|
||||||
assert.strictEqual("table", res[0]);
|
assert.strictEqual("table", res[0]);
|
||||||
@@ -200,7 +182,6 @@ describe("The 'eval' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns an appropriate representation of a Lua error reply', function (done) {
|
it('returns an appropriate representation of a Lua error reply', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.set("error reply key", "error reply value", function (err, res) {
|
client.set("error reply key", "error reply value", function (err, res) {
|
||||||
if (err) return done(err);
|
if (err) return done(err);
|
||||||
client.eval("local foo = redis.pcall('incr','error reply key'); return {type(foo),foo['err']}", 0, function (err, res) {
|
client.eval("local foo = redis.pcall('incr','error reply key'); return {type(foo),foo['err']}", 0, function (err, res) {
|
||||||
@@ -213,7 +194,6 @@ describe("The 'eval' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns an appropriate representation of a Lua nil reply', function (done) {
|
it('returns an appropriate representation of a Lua nil reply', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 5, 0]);
|
|
||||||
client.del("nil reply key", function (err, res) {
|
client.del("nil reply key", function (err, res) {
|
||||||
if (err) return done(err);
|
if (err) return done(err);
|
||||||
client.eval("local foo = redis.call('get','nil reply key'); return {type(foo),foo == false}", 0, function (err, res) {
|
client.eval("local foo = redis.call('get','nil reply key'); return {type(foo),foo == false}", 0, function (err, res) {
|
||||||
|
@@ -27,7 +27,6 @@ describe("The 'script' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("loads script with client.script('load')", function (done) {
|
it("loads script with client.script('load')", function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 6, 0]);
|
|
||||||
client.script("load", command, function(err, result) {
|
client.script("load", command, function(err, result) {
|
||||||
assert.strictEqual(result, commandSha);
|
assert.strictEqual(result, commandSha);
|
||||||
return done();
|
return done();
|
||||||
@@ -35,12 +34,10 @@ describe("The 'script' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('allows a loaded script to be evaluated', function (done) {
|
it('allows a loaded script to be evaluated', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 6, 0]);
|
|
||||||
client.evalsha(commandSha, 0, helper.isString('99', done));
|
client.evalsha(commandSha, 0, helper.isString('99', done));
|
||||||
});
|
});
|
||||||
|
|
||||||
it('allows a script to be loaded as part of a chained transaction', function (done) {
|
it('allows a script to be loaded as part of a chained transaction', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 6, 0]);
|
|
||||||
client.multi().script("load", command).exec(function(err, result) {
|
client.multi().script("load", command).exec(function(err, result) {
|
||||||
assert.strictEqual(result[0], commandSha);
|
assert.strictEqual(result[0], commandSha);
|
||||||
return done();
|
return done();
|
||||||
@@ -48,7 +45,6 @@ describe("The 'script' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("allows a script to be loaded using a transaction's array syntax", function (done) {
|
it("allows a script to be loaded using a transaction's array syntax", function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 6, 0]);
|
|
||||||
client.multi([['script', 'load', command]]).exec(function(err, result) {
|
client.multi([['script', 'load', command]]).exec(function(err, result) {
|
||||||
assert.strictEqual(result[0], commandSha);
|
assert.strictEqual(result[0], commandSha);
|
||||||
return done();
|
return done();
|
||||||
|
@@ -251,25 +251,18 @@ describe("The 'multi' method", function () {
|
|||||||
|
|
||||||
it('roles back a transaction when one command in a sequence of commands fails', function (done) {
|
it('roles back a transaction when one command in a sequence of commands fails', function (done) {
|
||||||
var multi1, multi2;
|
var multi1, multi2;
|
||||||
var expected = helper.serverVersionAtLeast(client, [2, 6, 5]) ? helper.isError() : function () {};
|
|
||||||
|
|
||||||
// Provoke an error at queue time
|
// Provoke an error at queue time
|
||||||
multi1 = client.MULTI();
|
multi1 = client.MULTI();
|
||||||
multi1.mset("multifoo", "10", "multibar", "20", helper.isString("OK"));
|
multi1.mset("multifoo", "10", "multibar", "20", helper.isString("OK"));
|
||||||
|
|
||||||
multi1.set("foo2", expected);
|
multi1.set("foo2", helper.isError());
|
||||||
multi1.incr("multifoo");
|
multi1.incr("multifoo");
|
||||||
multi1.incr("multibar");
|
multi1.incr("multibar");
|
||||||
multi1.exec(function () {
|
multi1.exec(function () {
|
||||||
// Redis 2.6.5+ will abort transactions with errors
|
// Redis 2.6.5+ will abort transactions with errors
|
||||||
// see: http://redis.io/topics/transactions
|
// see: http://redis.io/topics/transactions
|
||||||
var multibar_expected = 22;
|
var multibar_expected = 1;
|
||||||
var multifoo_expected = 12;
|
var multifoo_expected = 1;
|
||||||
if (helper.serverVersionAtLeast(client, [2, 6, 5])) {
|
|
||||||
multibar_expected = 1;
|
|
||||||
multifoo_expected = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Confirm that the previous command, while containing an error, still worked.
|
// Confirm that the previous command, while containing an error, still worked.
|
||||||
multi2 = client.multi();
|
multi2 = client.multi();
|
||||||
multi2.incr("multibar", helper.isNumber(multibar_expected));
|
multi2.incr("multibar", helper.isNumber(multibar_expected));
|
||||||
@@ -283,8 +276,6 @@ describe("The 'multi' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('roles back a transaction when one command in an array of commands fails', function (done) {
|
it('roles back a transaction when one command in an array of commands fails', function (done) {
|
||||||
var expected = helper.serverVersionAtLeast(client, [2, 6, 5]) ? helper.isError() : function () {};
|
|
||||||
|
|
||||||
// test nested multi-bulk replies
|
// test nested multi-bulk replies
|
||||||
client.multi([
|
client.multi([
|
||||||
["mget", "multifoo", "multibar", function (err, res) {
|
["mget", "multifoo", "multibar", function (err, res) {
|
||||||
@@ -292,22 +283,12 @@ describe("The 'multi' method", function () {
|
|||||||
assert.strictEqual(0, +res[0]);
|
assert.strictEqual(0, +res[0]);
|
||||||
assert.strictEqual(0, +res[1]);
|
assert.strictEqual(0, +res[1]);
|
||||||
}],
|
}],
|
||||||
["set", "foo2", expected],
|
["set", "foo2", helper.isError()],
|
||||||
["incr", "multifoo"],
|
["incr", "multifoo"],
|
||||||
["incr", "multibar"]
|
["incr", "multibar"]
|
||||||
]).exec(function (err, replies) {
|
]).exec(function (err, replies) {
|
||||||
if (helper.serverVersionAtLeast(client, [2, 6, 5])) {
|
assert.notEqual(err, null);
|
||||||
assert.notEqual(err, null);
|
assert.equal(replies, undefined);
|
||||||
assert.equal(replies, undefined);
|
|
||||||
} else {
|
|
||||||
assert.strictEqual(2, replies[0].length);
|
|
||||||
assert.strictEqual(null, replies[0][0]);
|
|
||||||
assert.strictEqual(null, replies[0][1]);
|
|
||||||
|
|
||||||
assert.strictEqual("1", replies[1].toString());
|
|
||||||
assert.strictEqual("1", replies[2].toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return done();
|
return done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -537,8 +518,6 @@ describe("The 'multi' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("emits an error if no callback has been provided and execabort error occured", function (done) {
|
it("emits an error if no callback has been provided and execabort error occured", function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 6, 5]);
|
|
||||||
|
|
||||||
var multi = client.multi();
|
var multi = client.multi();
|
||||||
multi.config("bar");
|
multi.config("bar");
|
||||||
multi.set("foo");
|
multi.set("foo");
|
||||||
@@ -551,8 +530,6 @@ describe("The 'multi' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should work without any callback", function (done) {
|
it("should work without any callback", function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 6, 5]);
|
|
||||||
|
|
||||||
var multi = client.multi();
|
var multi = client.multi();
|
||||||
multi.set("baz", "binary");
|
multi.set("baz", "binary");
|
||||||
multi.set("foo", "bar");
|
multi.set("foo", "bar");
|
||||||
@@ -583,8 +560,6 @@ describe("The 'multi' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should use transaction with exec_atomic and more than one command used", function (done) {
|
it("should use transaction with exec_atomic and more than one command used", function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 6, 5]);
|
|
||||||
|
|
||||||
var multi = client.multi();
|
var multi = client.multi();
|
||||||
var test = false;
|
var test = false;
|
||||||
multi.exec_batch = function () {
|
multi.exec_batch = function () {
|
||||||
@@ -597,8 +572,6 @@ describe("The 'multi' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("do not mutate arguments in the multi constructor", function (done) {
|
it("do not mutate arguments in the multi constructor", function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 6, 5]);
|
|
||||||
|
|
||||||
var input = [['set', 'foo', 'bar'], ['get', 'foo']];
|
var input = [['set', 'foo', 'bar'], ['get', 'foo']];
|
||||||
client.multi(input).exec(function (err, res) {
|
client.multi(input).exec(function (err, res) {
|
||||||
assert.strictEqual(input.length, 2);
|
assert.strictEqual(input.length, 2);
|
||||||
@@ -609,8 +582,6 @@ describe("The 'multi' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("works properly after a reconnect. issue #897", function (done) {
|
it("works properly after a reconnect. issue #897", function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 6, 5]);
|
|
||||||
|
|
||||||
client.stream.destroy();
|
client.stream.destroy();
|
||||||
client.on('error', function (err) {
|
client.on('error', function (err) {
|
||||||
assert.strictEqual(err.code, 'ECONNREFUSED');
|
assert.strictEqual(err.code, 'ECONNREFUSED');
|
||||||
@@ -625,8 +596,6 @@ describe("The 'multi' method", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("emits error once if reconnecting after multi has been executed but not yet returned without callback", function (done) {
|
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) {
|
client.on('error', function(err) {
|
||||||
assert.strictEqual(err.code, 'UNCERTAIN_STATE');
|
assert.strictEqual(err.code, 'UNCERTAIN_STATE');
|
||||||
done();
|
done();
|
||||||
|
@@ -345,8 +345,6 @@ describe("The node_redis client", function () {
|
|||||||
|
|
||||||
describe('monitor', function () {
|
describe('monitor', function () {
|
||||||
it('monitors commands on all other redis clients', function (done) {
|
it('monitors commands on all other redis clients', function (done) {
|
||||||
helper.serverVersionAtLeast.call(this, client, [2, 6, 0]);
|
|
||||||
|
|
||||||
var monitorClient = redis.createClient.apply(redis.createClient, args);
|
var monitorClient = redis.createClient.apply(redis.createClient, args);
|
||||||
var responses = [];
|
var responses = [];
|
||||||
|
|
||||||
|
@@ -104,8 +104,6 @@ describe("publish/subscribe", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('receives messages if subscribe is called after unsubscribe', function (done) {
|
it('receives messages if subscribe is called after unsubscribe', function (done) {
|
||||||
helper.serverVersionAtLeast.bind(this)(sub, [2, 6, 11]);
|
|
||||||
|
|
||||||
var end = helper.callFuncAfter(done, 2);
|
var end = helper.callFuncAfter(done, 2);
|
||||||
sub.once("subscribe", function (chnl, count) {
|
sub.once("subscribe", function (chnl, count) {
|
||||||
pub.publish(channel, message, function (err, res) {
|
pub.publish(channel, message, function (err, res) {
|
||||||
@@ -126,8 +124,6 @@ describe("publish/subscribe", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('handles SUB_UNSUB_MSG_SUB', function (done) {
|
it('handles SUB_UNSUB_MSG_SUB', function (done) {
|
||||||
helper.serverVersionAtLeast.bind(this)(sub, [2, 6, 11]);
|
|
||||||
|
|
||||||
sub.subscribe('chan8');
|
sub.subscribe('chan8');
|
||||||
sub.subscribe('chan9');
|
sub.subscribe('chan9');
|
||||||
sub.unsubscribe('chan9');
|
sub.unsubscribe('chan9');
|
||||||
@@ -138,8 +134,6 @@ describe("publish/subscribe", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('handles SUB_UNSUB_MSG_SUB 2', function (done) {
|
it('handles SUB_UNSUB_MSG_SUB 2', function (done) {
|
||||||
helper.serverVersionAtLeast.bind(this)(sub, [2, 6, 11]);
|
|
||||||
|
|
||||||
sub.psubscribe('abc*');
|
sub.psubscribe('abc*');
|
||||||
sub.subscribe('xyz');
|
sub.subscribe('xyz');
|
||||||
sub.unsubscribe('xyz');
|
sub.unsubscribe('xyz');
|
||||||
@@ -241,8 +235,6 @@ describe("publish/subscribe", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('executes callback when unsubscribe is called and there are no subscriptions', function (done) {
|
it('executes callback when unsubscribe is called and there are no subscriptions', function (done) {
|
||||||
helper.serverVersionAtLeast.bind(this)(sub, [2, 6, 11]);
|
|
||||||
|
|
||||||
pub.unsubscribe(function (err, results) {
|
pub.unsubscribe(function (err, results) {
|
||||||
assert.strictEqual(null, results);
|
assert.strictEqual(null, results);
|
||||||
return done(err);
|
return done(err);
|
||||||
@@ -270,8 +262,6 @@ describe("publish/subscribe", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('executes callback when punsubscribe is called and there are no subscriptions', function (done) {
|
it('executes callback when punsubscribe is called and there are no subscriptions', function (done) {
|
||||||
helper.serverVersionAtLeast.bind(this)(sub, [2, 6, 11]);
|
|
||||||
|
|
||||||
pub.punsubscribe(function (err, results) {
|
pub.punsubscribe(function (err, results) {
|
||||||
assert.strictEqual(null, results);
|
assert.strictEqual(null, results);
|
||||||
return done(err);
|
return done(err);
|
||||||
|
Reference in New Issue
Block a user