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

Add host and port to options object

This commit is contained in:
Ruben Bridgewater
2015-09-30 02:35:11 +02:00
parent 3c39a8bdfc
commit 977d4dba2b
3 changed files with 34 additions and 3 deletions

View File

@@ -79,6 +79,34 @@ describe("on lost connection", function () {
});
});
it("can not connect with wrong host / port in the options object", function (done) {
var client = redis.createClient({
host: 'somewhere',
port: 6379,
max_attempts: 1
});
var end = helper.callFuncAfter(done, 2);
client.on('error', function (err) {
assert(/CONNECTION_BROKEN|ENOTFOUND/.test(err.code));
end();
});
});
it("connect with host and port provided in the options object", function (done) {
var client = redis.createClient({
host: 'localhost',
port: '6379',
parser: parser,
connect_timeout: 1000
});
client.once('ready', function() {
done();
});
});
});
});
});