diff --git a/script/create-test-tables.js b/script/create-test-tables.js index 705709f..1a7c47d 100644 --- a/script/create-test-tables.js +++ b/script/create-test-tables.js @@ -32,6 +32,8 @@ var people = [ ] var con = new pg.Client({ + host: args.host, + port: args.port, user: args.user, password: args.password, database: args.database diff --git a/test/integration/connection/test-helper.js b/test/integration/connection/test-helper.js index 6390119..0be05d2 100644 --- a/test/integration/connection/test-helper.js +++ b/test/integration/connection/test-helper.js @@ -9,7 +9,7 @@ var connect = function(callback) { console.log(error); throw new Error("Connection error"); }); - con.connect('5432','localhost'); + con.connect(helper.args.port || '5432', helper.args.host || 'localhost'); con.once('connect', function() { con.startup({ user: username, diff --git a/test/unit/client/test-helper.js b/test/unit/client/test-helper.js index b09bfe4..54f515b 100644 --- a/test/unit/client/test-helper.js +++ b/test/unit/client/test-helper.js @@ -1,4 +1,4 @@ -require(__dirname+'/../test-helper'); +var helper = require(__dirname+'/../test-helper'); var Connection = require('connection'); var makeClient = function() { var connection = new Connection({stream: "no"}); @@ -9,7 +9,7 @@ var makeClient = function() { }; connection.queries = []; var client = new Client({connection: connection}); - client.connect(); + client.connect(helper.args.port, helper.args.host); client.connection.emit('connect'); return client; }; diff --git a/test/unit/test-helper.js b/test/unit/test-helper.js index 7999c54..383791b 100644 --- a/test/unit/test-helper.js +++ b/test/unit/test-helper.js @@ -23,3 +23,5 @@ createClient = function() { client.connect(); return client; }; + +module.exports = helper;