1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Add guards to some newer tests for older Redis server differences. Fixes #430

This commit is contained in:
Bryce Baril
2013-05-05 10:01:38 -07:00
parent 50b1c90bf2
commit 807aaf91b7

14
test.js
View File

@@ -324,6 +324,11 @@ tests.MULTI_7 = function () {
tests.MULTI_EXCEPTION_1 = function() {
var name = "MULTI_EXCEPTION_1";
if (!server_version_at_least(client, [2, 6, 5])) {
console.log("Skipping " + name + " for old Redis server version < 2.6.5");
return next(name);
}
client.multi().set("foo").exec(function (err, reply) {
assert(Array.isArray(err), "err should be an array");
assert.equal(2, err.length, "err should have 2 items");
@@ -945,6 +950,9 @@ tests.PUNSUB_EMPTY_CB = function () {
tests.SUB_UNSUB_SUB = function () {
var name = "SUB_UNSUB_SUB";
// test hangs on older versions of redis, so skip
if (!server_version_at_least(client, [2, 6, 11])) return next(name);
client3.subscribe('chan3');
client3.unsubscribe('chan3');
client3.subscribe('chan3', function (err, results) {
@@ -961,6 +969,9 @@ tests.SUB_UNSUB_SUB = function () {
tests.SUB_UNSUB_MSG_SUB = function () {
var name = "SUB_UNSUB_MSG_SUB";
// test hangs on older versions of redis, so skip
if (!server_version_at_least(client, [2, 6, 11])) return next(name);
client3.subscribe('chan8');
client3.subscribe('chan9');
client3.unsubscribe('chan9');
@@ -972,6 +983,9 @@ tests.SUB_UNSUB_MSG_SUB = function () {
tests.PSUB_UNSUB_PMSG_SUB = function () {
var name = "PSUB_UNSUB_PMSG_SUB";
// test hangs on older versions of redis, so skip
if (!server_version_at_least(client, [2, 6, 11])) return next(name);
client3.psubscribe('abc*');
client3.subscribe('xyz');
client3.unsubscribe('xyz');