1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Add unify_options / createClient tests

This commit is contained in:
Ruben Bridgewater
2016-03-01 16:39:52 +01:00
parent 6013ee7f90
commit 711d51c387
2 changed files with 241 additions and 24 deletions

View File

@@ -327,30 +327,6 @@ describe("connection tests", function () {
assert(create_stream_string === String(redis.RedisClient.prototype.create_stream));
});
it("throws on strange connection info", function () {
client = {
end: function() {}
};
try {
redis.createClient(true);
throw new Error('failed');
} catch (err) {
assert.equal(err.message, 'Unknown type of connection in createClient()');
}
});
it("throws on protocol other than redis in the redis url", function () {
client = {
end: function() {}
};
try {
redis.createClient(config.HOST[ip] + ':' + config.PORT);
throw new Error('failed');
} catch (err) {
assert.equal(err.message, 'Connection string must use the "redis:" protocol or begin with slashes //');
}
});
if (ip === 'IPv4') {
it('allows connecting with the redis url to the default host and port, select db 3 and warn about duplicate db option', function (done) {
client = redis.createClient('redis:///3?db=3');