You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
tests: remove unused parser
client option from all tests & helpers
This commit is contained in:
@@ -19,9 +19,9 @@ describe('client authentication', function () {
|
|||||||
|
|
||||||
helper.allTests({
|
helper.allTests({
|
||||||
allConnections: true
|
allConnections: true
|
||||||
}, function (parser, ip, args) {
|
}, function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var auth = 'porkchopsandwiches';
|
var auth = 'porkchopsandwiches';
|
||||||
var client = null;
|
var client = null;
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ describe('client authentication', function () {
|
|||||||
it('allows auth to be provided as config option for client', function (done) {
|
it('allows auth to be provided as config option for client', function (done) {
|
||||||
if (helper.redisProcess().spawnFailed()) this.skip();
|
if (helper.redisProcess().spawnFailed()) this.skip();
|
||||||
|
|
||||||
var args = config.configureClient(parser, ip, {
|
var args = config.configureClient(ip, {
|
||||||
auth_pass: auth
|
auth_pass: auth
|
||||||
});
|
});
|
||||||
client = redis.createClient.apply(null, args);
|
client = redis.createClient.apply(null, args);
|
||||||
@@ -143,7 +143,7 @@ describe('client authentication', function () {
|
|||||||
it('allows auth and no_ready_check to be provided as config option for client', function (done) {
|
it('allows auth and no_ready_check to be provided as config option for client', function (done) {
|
||||||
if (helper.redisProcess().spawnFailed()) this.skip();
|
if (helper.redisProcess().spawnFailed()) this.skip();
|
||||||
|
|
||||||
var args = config.configureClient(parser, ip, {
|
var args = config.configureClient(ip, {
|
||||||
password: auth,
|
password: auth,
|
||||||
no_ready_check: true
|
no_ready_check: true
|
||||||
});
|
});
|
||||||
@@ -154,7 +154,7 @@ describe('client authentication', function () {
|
|||||||
it('allows auth to be provided post-hoc with auth method', function (done) {
|
it('allows auth to be provided post-hoc with auth method', function (done) {
|
||||||
if (helper.redisProcess().spawnFailed()) this.skip();
|
if (helper.redisProcess().spawnFailed()) this.skip();
|
||||||
|
|
||||||
var args = config.configureClient(parser, ip);
|
var args = config.configureClient(ip);
|
||||||
client = redis.createClient.apply(null, args);
|
client = redis.createClient.apply(null, args);
|
||||||
client.auth(auth);
|
client.auth(auth);
|
||||||
client.on('ready', done);
|
client.on('ready', done);
|
||||||
@@ -217,7 +217,7 @@ describe('client authentication', function () {
|
|||||||
it('allows auth to be provided post-hoc with auth method again', function (done) {
|
it('allows auth to be provided post-hoc with auth method again', function (done) {
|
||||||
if (helper.redisProcess().spawnFailed()) this.skip();
|
if (helper.redisProcess().spawnFailed()) this.skip();
|
||||||
|
|
||||||
var args = config.configureClient(parser, ip, {
|
var args = config.configureClient(ip, {
|
||||||
auth_pass: auth
|
auth_pass: auth
|
||||||
});
|
});
|
||||||
client = redis.createClient.apply(null, args);
|
client = redis.createClient.apply(null, args);
|
||||||
@@ -229,7 +229,7 @@ describe('client authentication', function () {
|
|||||||
it('does not allow any commands to be processed if not authenticated using no_ready_check true', function (done) {
|
it('does not allow any commands to be processed if not authenticated using no_ready_check true', function (done) {
|
||||||
if (helper.redisProcess().spawnFailed()) this.skip();
|
if (helper.redisProcess().spawnFailed()) this.skip();
|
||||||
|
|
||||||
var args = config.configureClient(parser, ip, {
|
var args = config.configureClient(ip, {
|
||||||
no_ready_check: true
|
no_ready_check: true
|
||||||
});
|
});
|
||||||
client = redis.createClient.apply(null, args);
|
client = redis.createClient.apply(null, args);
|
||||||
@@ -258,7 +258,6 @@ describe('client authentication', function () {
|
|||||||
if (helper.redisProcess().spawnFailed()) this.skip();
|
if (helper.redisProcess().spawnFailed()) this.skip();
|
||||||
client = redis.createClient({
|
client = redis.createClient({
|
||||||
password: 'wrong_password',
|
password: 'wrong_password',
|
||||||
parser: parser
|
|
||||||
});
|
});
|
||||||
client.once('error', function (err) {
|
client.once('error', function (err) {
|
||||||
assert.strictEqual(err.message, 'ERR invalid password');
|
assert.strictEqual(err.message, 'ERR invalid password');
|
||||||
@@ -269,7 +268,7 @@ describe('client authentication', function () {
|
|||||||
it('pubsub working with auth', function (done) {
|
it('pubsub working with auth', function (done) {
|
||||||
if (helper.redisProcess().spawnFailed()) this.skip();
|
if (helper.redisProcess().spawnFailed()) this.skip();
|
||||||
|
|
||||||
var args = config.configureClient(parser, ip, {
|
var args = config.configureClient(ip, {
|
||||||
password: auth
|
password: auth
|
||||||
});
|
});
|
||||||
client = redis.createClient.apply(null, args);
|
client = redis.createClient.apply(null, args);
|
||||||
@@ -299,7 +298,7 @@ describe('client authentication', function () {
|
|||||||
// returning the manipulated [error, result] from the callback.
|
// returning the manipulated [error, result] from the callback.
|
||||||
// There should be a better solution though
|
// There should be a better solution though
|
||||||
|
|
||||||
var args = config.configureClient(parser, 'localhost', {
|
var args = config.configureClient('localhost', {
|
||||||
noReadyCheck: true
|
noReadyCheck: true
|
||||||
});
|
});
|
||||||
client = redis.createClient.apply(null, args);
|
client = redis.createClient.apply(null, args);
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'batch' method", function () {
|
describe("The 'batch' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
|
|
||||||
describe('when not connected', function () {
|
describe('when not connected', function () {
|
||||||
var client;
|
var client;
|
||||||
|
@@ -8,9 +8,9 @@ var intercept = require('intercept-stdout');
|
|||||||
|
|
||||||
describe("The 'blpop' method", function () {
|
describe("The 'blpop' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
var bclient;
|
var bclient;
|
||||||
|
|
||||||
|
@@ -7,10 +7,10 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'client' method", function () {
|
describe("The 'client' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
var pattern = /addr=/;
|
var pattern = /addr=/;
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -8,9 +8,9 @@ var uuid = require('uuid');
|
|||||||
|
|
||||||
describe("The 'dbsize' method", function () {
|
describe("The 'dbsize' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var key, value;
|
var key, value;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'del' method", function () {
|
describe("The 'del' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -8,9 +8,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'eval' method", function () {
|
describe("The 'eval' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
var source = "return redis.call('set', 'sha', 'test')";
|
var source = "return redis.call('set', 'sha', 'test')";
|
||||||
|
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'exists' method", function () {
|
describe("The 'exists' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'expire' method", function () {
|
describe("The 'expire' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -8,9 +8,9 @@ var uuid = require('uuid');
|
|||||||
|
|
||||||
describe("The 'flushdb' method", function () {
|
describe("The 'flushdb' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var key, key2;
|
var key, key2;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'geoadd' method", function () {
|
describe("The 'geoadd' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -8,9 +8,9 @@ var uuid = require('uuid');
|
|||||||
|
|
||||||
describe("The 'get' method", function () {
|
describe("The 'get' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var key, value;
|
var key, value;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
@@ -8,9 +8,9 @@ var uuid = require('uuid');
|
|||||||
|
|
||||||
describe("The 'getset' method", function () {
|
describe("The 'getset' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var key, value, value2;
|
var key, value, value2;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'hgetall' method", function () {
|
describe("The 'hgetall' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
describe('regular client', function () {
|
describe('regular client', function () {
|
||||||
@@ -51,7 +51,7 @@ describe("The 'hgetall' method", function () {
|
|||||||
|
|
||||||
describe('binary client', function () {
|
describe('binary client', function () {
|
||||||
var client;
|
var client;
|
||||||
var args = config.configureClient(parser, ip, {
|
var args = config.configureClient(ip, {
|
||||||
return_buffers: true
|
return_buffers: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'hincrby' method", function () {
|
describe("The 'hincrby' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
var hash = 'test hash';
|
var hash = 'test hash';
|
||||||
|
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'hlen' method", function () {
|
describe("The 'hlen' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'hmget' method", function () {
|
describe("The 'hmget' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
var hash = 'test hash';
|
var hash = 'test hash';
|
||||||
|
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'hmset' method", function () {
|
describe("The 'hmset' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
var hash = 'test hash';
|
var hash = 'test hash';
|
||||||
|
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'hset' method", function () {
|
describe("The 'hset' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
var hash = 'test hash';
|
var hash = 'test hash';
|
||||||
|
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'incr' method", function () {
|
describe("The 'incr' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
|
|
||||||
describe('when connected and a value in Redis', function () {
|
describe('when connected and a value in Redis', function () {
|
||||||
|
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'info' method", function () {
|
describe("The 'info' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -8,9 +8,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'keys' method", function () {
|
describe("The 'keys' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'mget' method", function () {
|
describe("The 'mget' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -8,7 +8,7 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'monitor' method", function () {
|
describe("The 'monitor' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ describe("The 'monitor' method", function () {
|
|||||||
end(err);
|
end(err);
|
||||||
});
|
});
|
||||||
monitorClient.subscribe('foo', 'baz', function (err, res) {
|
monitorClient.subscribe('foo', 'baz', function (err, res) {
|
||||||
// The return value might change in v.3
|
// The return value might change in v.4
|
||||||
// assert.strictEqual(res, 'baz');
|
// assert.strictEqual(res, 'baz');
|
||||||
// TODO: Fix the return value of subscribe calls
|
// TODO: Fix the return value of subscribe calls
|
||||||
end(err);
|
end(err);
|
||||||
|
@@ -8,9 +8,9 @@ var uuid = require('uuid');
|
|||||||
|
|
||||||
describe("The 'mset' method", function () {
|
describe("The 'mset' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var key, value, key2, value2;
|
var key, value, key2, value2;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'msetnx' method", function () {
|
describe("The 'msetnx' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'randomkey' method", function () {
|
describe("The 'randomkey' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'rename' method", function () {
|
describe("The 'rename' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'renamenx' method", function () {
|
describe("The 'renamenx' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var assert = require('assert');
|
|||||||
|
|
||||||
describe("The 'rpush' command", function () {
|
describe("The 'rpush' command", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'sadd' method", function () {
|
describe("The 'sadd' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'scard' method", function () {
|
describe("The 'scard' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -8,11 +8,11 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'script' method", function () {
|
describe("The 'script' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
var command = 'return 99';
|
var command = 'return 99';
|
||||||
var commandSha = crypto.createHash('sha1').update(command).digest('hex');
|
var commandSha = crypto.createHash('sha1').update(command).digest('hex');
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'sdiff' method", function () {
|
describe("The 'sdiff' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'sdiffstore' method", function () {
|
describe("The 'sdiffstore' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'select' method", function () {
|
describe("The 'select' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
describe('when not connected', function () {
|
describe('when not connected', function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
|
@@ -8,9 +8,9 @@ var uuid = require('uuid');
|
|||||||
|
|
||||||
describe("The 'set' method", function () {
|
describe("The 'set' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var key, value;
|
var key, value;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'setex' method", function () {
|
describe("The 'setex' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'setnx' method", function () {
|
describe("The 'setnx' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'sinter' method", function () {
|
describe("The 'sinter' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'sinterstore' method", function () {
|
describe("The 'sinterstore' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'sismember' method", function () {
|
describe("The 'sismember' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'slowlog' method", function () {
|
describe("The 'slowlog' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'smembers' method", function () {
|
describe("The 'smembers' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'smove' method", function () {
|
describe("The 'smove' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -34,9 +34,9 @@ function setupData (client, done) {
|
|||||||
|
|
||||||
describe("The 'sort' method", function () {
|
describe("The 'sort' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'spop' method", function () {
|
describe("The 'spop' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'srem' method", function () {
|
describe("The 'srem' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'sunion' method", function () {
|
describe("The 'sunion' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'sunionstore' method", function () {
|
describe("The 'sunionstore' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'ttl' method", function () {
|
describe("The 'ttl' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -6,9 +6,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'type' method", function () {
|
describe("The 'type' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,11 +7,11 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'watch' method", function () {
|
describe("The 'watch' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
var watched = 'foobar';
|
var watched = 'foobar';
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'zadd' method", function () {
|
describe("The 'zadd' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'zscan' method", function () {
|
describe("The 'zscan' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe("The 'zscore' method", function () {
|
describe("The 'zscore' method", function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
|
@@ -147,9 +147,9 @@ describe('connection tests', function () {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
|
|
||||||
describe('on lost connection', function () {
|
describe('on lost connection', function () {
|
||||||
it('emit an error after max retry timeout and do not try to reconnect afterwards', function (done) {
|
it('emit an error after max retry timeout and do not try to reconnect afterwards', function (done) {
|
||||||
@@ -158,7 +158,6 @@ describe('connection tests', function () {
|
|||||||
|
|
||||||
var connect_timeout = 600; // in ms
|
var connect_timeout = 600; // in ms
|
||||||
client = redis.createClient({
|
client = redis.createClient({
|
||||||
parser: parser,
|
|
||||||
connect_timeout: connect_timeout
|
connect_timeout: connect_timeout
|
||||||
});
|
});
|
||||||
var time = 0;
|
var time = 0;
|
||||||
@@ -189,7 +188,6 @@ describe('connection tests', function () {
|
|||||||
it('end connection while retry is still ongoing', function (done) {
|
it('end connection while retry is still ongoing', function (done) {
|
||||||
var connect_timeout = 1000; // in ms
|
var connect_timeout = 1000; // in ms
|
||||||
client = redis.createClient({
|
client = redis.createClient({
|
||||||
parser: parser,
|
|
||||||
connect_timeout: connect_timeout
|
connect_timeout: connect_timeout
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -304,7 +302,6 @@ describe('connection tests', function () {
|
|||||||
it('emit an error after the socket timeout exceeded the connect_timeout time', function (done) {
|
it('emit an error after the socket timeout exceeded the connect_timeout time', function (done) {
|
||||||
var connect_timeout = 500; // in ms
|
var connect_timeout = 500; // in ms
|
||||||
client = redis.createClient({
|
client = redis.createClient({
|
||||||
parser: parser,
|
|
||||||
// Auto detect ipv4 and use non routable ip to trigger the timeout
|
// Auto detect ipv4 and use non routable ip to trigger the timeout
|
||||||
host: '10.255.255.1',
|
host: '10.255.255.1',
|
||||||
connect_timeout: connect_timeout
|
connect_timeout: connect_timeout
|
||||||
@@ -337,7 +334,6 @@ describe('connection tests', function () {
|
|||||||
|
|
||||||
it('use the system socket timeout if the connect_timeout has not been provided', function (done) {
|
it('use the system socket timeout if the connect_timeout has not been provided', function (done) {
|
||||||
client = redis.createClient({
|
client = redis.createClient({
|
||||||
parser: parser,
|
|
||||||
host: '2001:db8::ff00:42:8329' // auto detect ip v6
|
host: '2001:db8::ff00:42:8329' // auto detect ip v6
|
||||||
});
|
});
|
||||||
assert.strictEqual(client.address, '2001:db8::ff00:42:8329:6379');
|
assert.strictEqual(client.address, '2001:db8::ff00:42:8329:6379');
|
||||||
@@ -350,21 +346,20 @@ describe('connection tests', function () {
|
|||||||
|
|
||||||
it('clears the socket timeout after a connection has been established', function (done) {
|
it('clears the socket timeout after a connection has been established', function (done) {
|
||||||
client = redis.createClient({
|
client = redis.createClient({
|
||||||
parser: parser,
|
|
||||||
connect_timeout: 1000
|
connect_timeout: 1000
|
||||||
});
|
});
|
||||||
process.nextTick(function () {
|
process.nextTick(function () {
|
||||||
// node > 4
|
// node > 6
|
||||||
var timeout = client.stream.timeout;
|
var timeout = client.stream.timeout;
|
||||||
// node <= 4
|
// node <= 6
|
||||||
if (timeout === undefined) timeout = client.stream._idleTimeout;
|
if (timeout === undefined) timeout = client.stream._idleTimeout;
|
||||||
assert.strictEqual(timeout, 1000);
|
assert.strictEqual(timeout, 1000);
|
||||||
});
|
});
|
||||||
client.on('connect', function () {
|
client.on('connect', function () {
|
||||||
// node > 4
|
// node > 6
|
||||||
var expected = 0;
|
var expected = 0;
|
||||||
var timeout = client.stream.timeout;
|
var timeout = client.stream.timeout;
|
||||||
// node <= 4
|
// node <= 6
|
||||||
if (timeout === undefined) {
|
if (timeout === undefined) {
|
||||||
timeout = client.stream._idleTimeout;
|
timeout = client.stream._idleTimeout;
|
||||||
expected = -1;
|
expected = -1;
|
||||||
@@ -379,7 +374,6 @@ describe('connection tests', function () {
|
|||||||
client = redis.createClient({
|
client = redis.createClient({
|
||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
port: '6379',
|
port: '6379',
|
||||||
parser: parser,
|
|
||||||
connect_timeout: 1000
|
connect_timeout: 1000
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -392,7 +386,6 @@ describe('connection tests', function () {
|
|||||||
}
|
}
|
||||||
client = redis.createClient({
|
client = redis.createClient({
|
||||||
path: '/tmp/redis.sock',
|
path: '/tmp/redis.sock',
|
||||||
parser: parser,
|
|
||||||
connect_timeout: 1000
|
connect_timeout: 1000
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@ var redis = config.redis;
|
|||||||
describe('detect_buffers', function () {
|
describe('detect_buffers', function () {
|
||||||
|
|
||||||
var client;
|
var client;
|
||||||
var args = config.configureClient('javascript', 'localhost', {
|
var args = config.configureClient('localhost', {
|
||||||
detect_buffers: true
|
detect_buffers: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -161,7 +161,6 @@ module.exports = {
|
|||||||
cb = opts;
|
cb = opts;
|
||||||
opts = {};
|
opts = {};
|
||||||
}
|
}
|
||||||
var parsers = ['javascript'];
|
|
||||||
var protocols = ['IPv4'];
|
var protocols = ['IPv4'];
|
||||||
if (process.platform !== 'win32') {
|
if (process.platform !== 'win32') {
|
||||||
protocols.push('IPv6', '/tmp/redis.sock');
|
protocols.push('IPv6', '/tmp/redis.sock');
|
||||||
@@ -180,13 +179,11 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
describe('using options: ' + strOptions, function () {
|
describe('using options: ' + strOptions, function () {
|
||||||
parsers.forEach(function (parser) {
|
protocols.forEach(function (ip, i) {
|
||||||
protocols.forEach(function (ip, i) {
|
if (i !== 0 && !opts.allConnections) {
|
||||||
if (i !== 0 && !opts.allConnections) {
|
return;
|
||||||
return;
|
}
|
||||||
}
|
cb(ip, config.configureClient(ip, options));
|
||||||
cb(parser, ip, config.configureClient(parser, ip, options));
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -16,7 +16,7 @@ var config = {
|
|||||||
IPv4: '127.0.0.1',
|
IPv4: '127.0.0.1',
|
||||||
IPv6: '::1'
|
IPv6: '::1'
|
||||||
},
|
},
|
||||||
configureClient: function (parser, ip, opts) {
|
configureClient: function (ip, opts) {
|
||||||
var args = [];
|
var args = [];
|
||||||
// Do not manipulate the opts => copy them each time
|
// Do not manipulate the opts => copy them each time
|
||||||
opts = opts ? JSON.parse(JSON.stringify(opts)) : {};
|
opts = opts ? JSON.parse(JSON.stringify(opts)) : {};
|
||||||
@@ -28,8 +28,6 @@ var config = {
|
|||||||
args.push(config.HOST[ip]);
|
args.push(config.HOST[ip]);
|
||||||
opts.family = ip;
|
opts.family = ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
opts.parser = parser;
|
|
||||||
args.push(opts);
|
args.push(opts);
|
||||||
|
|
||||||
return args;
|
return args;
|
||||||
|
@@ -93,9 +93,9 @@ describe("The 'multi' method", function () {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
|
|
||||||
describe('when not connected', function () {
|
describe('when not connected', function () {
|
||||||
|
|
||||||
|
@@ -79,9 +79,9 @@ describe('The node_redis client', function () {
|
|||||||
client.stream.destroy();
|
client.stream.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
|
|
||||||
afterEach(function () {
|
afterEach(function () {
|
||||||
client.end(true);
|
client.end(true);
|
||||||
@@ -375,7 +375,6 @@ describe('The node_redis client', function () {
|
|||||||
|
|
||||||
it('should retry all commands instead of returning an error if a command did not yet return after a connection loss', function (done) {
|
it('should retry all commands instead of returning an error if a command did not yet return after a connection loss', function (done) {
|
||||||
var bclient = redis.createClient({
|
var bclient = redis.createClient({
|
||||||
parser: parser,
|
|
||||||
retry_unfulfilled_commands: true
|
retry_unfulfilled_commands: true
|
||||||
});
|
});
|
||||||
bclient.blpop('blocking list 2', 5, function (err, value) {
|
bclient.blpop('blocking list 2', 5, function (err, value) {
|
||||||
@@ -394,7 +393,6 @@ describe('The node_redis client', function () {
|
|||||||
|
|
||||||
it('should retry all commands even if the offline queue is disabled', function (done) {
|
it('should retry all commands even if the offline queue is disabled', function (done) {
|
||||||
var bclient = redis.createClient({
|
var bclient = redis.createClient({
|
||||||
parser: parser,
|
|
||||||
enableOfflineQueue: false,
|
enableOfflineQueue: false,
|
||||||
retryUnfulfilledCommands: true
|
retryUnfulfilledCommands: true
|
||||||
});
|
});
|
||||||
@@ -751,7 +749,7 @@ describe('The node_redis client', function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: consider allowing loading commands in v.3
|
// TODO: consider allowing loading commands in v.4
|
||||||
// it('should fire early', function (done) {
|
// it('should fire early', function (done) {
|
||||||
// client = redis.createClient.apply(null, args);
|
// client = redis.createClient.apply(null, args);
|
||||||
// var fired = false;
|
// var fired = false;
|
||||||
@@ -884,9 +882,7 @@ describe('The node_redis client', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('flushes the command queue if connection is lost', function (done) {
|
it('flushes the command queue if connection is lost', function (done) {
|
||||||
client = redis.createClient({
|
client = redis.createClient();
|
||||||
parser: parser
|
|
||||||
});
|
|
||||||
|
|
||||||
client.once('ready', function () {
|
client.once('ready', function () {
|
||||||
var multi = client.multi();
|
var multi = client.multi();
|
||||||
@@ -938,7 +934,6 @@ describe('The node_redis client', function () {
|
|||||||
|
|
||||||
it('stream not writable', function (done) {
|
it('stream not writable', function (done) {
|
||||||
client = redis.createClient({
|
client = redis.createClient({
|
||||||
parser: parser,
|
|
||||||
enable_offline_queue: false
|
enable_offline_queue: false
|
||||||
});
|
});
|
||||||
client.on('ready', function () {
|
client.on('ready', function () {
|
||||||
@@ -952,7 +947,6 @@ describe('The node_redis client', function () {
|
|||||||
|
|
||||||
it('emit an error and does not enqueues operation', function (done) {
|
it('emit an error and does not enqueues operation', function (done) {
|
||||||
client = redis.createClient(9999, null, {
|
client = redis.createClient(9999, null, {
|
||||||
parser: parser,
|
|
||||||
max_attempts: 0,
|
max_attempts: 0,
|
||||||
enable_offline_queue: false
|
enable_offline_queue: false
|
||||||
});
|
});
|
||||||
@@ -977,7 +971,6 @@ describe('The node_redis client', function () {
|
|||||||
|
|
||||||
it('flushes the command queue if connection is lost', function (done) {
|
it('flushes the command queue if connection is lost', function (done) {
|
||||||
client = redis.createClient({
|
client = redis.createClient({
|
||||||
parser: parser,
|
|
||||||
enable_offline_queue: false
|
enable_offline_queue: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -7,14 +7,13 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe('prefix key names', function () {
|
describe('prefix key names', function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client = null;
|
var client = null;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
client = redis.createClient({
|
client = redis.createClient({
|
||||||
parser: parser,
|
|
||||||
prefix: 'test:prefix:'
|
prefix: 'test:prefix:'
|
||||||
});
|
});
|
||||||
client.on('ready', function () {
|
client.on('ready', function () {
|
||||||
|
@@ -7,9 +7,9 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe('publish/subscribe', function () {
|
describe('publish/subscribe', function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var pub = null;
|
var pub = null;
|
||||||
var sub = null;
|
var sub = null;
|
||||||
var channel = 'test channel';
|
var channel = 'test channel';
|
||||||
|
@@ -17,9 +17,9 @@ describe('rename commands', function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, args) {
|
helper.allTests(function (ip, args) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client = null;
|
var client = null;
|
||||||
|
|
||||||
beforeEach(function (done) {
|
beforeEach(function (done) {
|
||||||
@@ -29,7 +29,6 @@ describe('rename commands', function () {
|
|||||||
set: '807081f5afa96845a02816a28b7258c3',
|
set: '807081f5afa96845a02816a28b7258c3',
|
||||||
GETRANGE: '9e3102b15cf231c4e9e940f284744fe0'
|
GETRANGE: '9e3102b15cf231c4e9e940f284744fe0'
|
||||||
},
|
},
|
||||||
parser: parser
|
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on('ready', function () {
|
client.on('ready', function () {
|
||||||
@@ -124,7 +123,6 @@ describe('rename commands', function () {
|
|||||||
rename_commands: {
|
rename_commands: {
|
||||||
set: '807081f5afa96845a02816a28b7258c3'
|
set: '807081f5afa96845a02816a28b7258c3'
|
||||||
},
|
},
|
||||||
parser: parser,
|
|
||||||
prefix: 'baz'
|
prefix: 'baz'
|
||||||
});
|
});
|
||||||
client.set('foo', 'bar');
|
client.set('foo', 'bar');
|
||||||
|
@@ -7,11 +7,11 @@ var redis = config.redis;
|
|||||||
|
|
||||||
describe('return_buffers', function () {
|
describe('return_buffers', function () {
|
||||||
|
|
||||||
helper.allTests(function (parser, ip, basicArgs) {
|
helper.allTests(function (ip, basicArgs) {
|
||||||
|
|
||||||
describe('using ' + parser + ' and ' + ip, function () {
|
describe('using ' + ip, function () {
|
||||||
var client;
|
var client;
|
||||||
var args = config.configureClient(parser, ip, {
|
var args = config.configureClient(ip, {
|
||||||
return_buffers: true,
|
return_buffers: true,
|
||||||
detect_buffers: true
|
detect_buffers: true
|
||||||
});
|
});
|
||||||
@@ -243,7 +243,7 @@ describe('return_buffers', function () {
|
|||||||
var channel = 'test channel';
|
var channel = 'test channel';
|
||||||
var message = new Buffer('test message');
|
var message = new Buffer('test message');
|
||||||
|
|
||||||
var args = config.configureClient(parser, ip, {
|
var args = config.configureClient(ip, {
|
||||||
return_buffers: true
|
return_buffers: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user