diff --git a/lib/client.js b/lib/client.js index 441b66e..78506f6 100644 --- a/lib/client.js +++ b/lib/client.js @@ -55,7 +55,7 @@ Client.prototype.connect = function(host, callback) { self.up.once('up', function(remote) { self.ready = true self.emit('ready', remote, self.connection) - return callback() + return callback(null, remote, self.connection) }) }) return this diff --git a/tests/client.js b/tests/client.js index ae7dede..37ab1bf 100644 --- a/tests/client.js +++ b/tests/client.js @@ -64,9 +64,12 @@ describe('client', function() { }) }) }) - describe('listening on a port', function() { + describe('connecting to a port', function() { it('will use callback when listening on port', function(done) { - client = new Client().connect(PORT, function() { + client = new Client().connect(PORT, function(err, remote, connection) { + assert.ok(!err) + assert.ok(remote) + assert.ok(connection.id) done() }) })