Skip to content

Commit 6dd0157

Browse files
committed
Fixes for testing with non-local Postgres server.
1 parent d58fa16 commit 6dd0157

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

script/create-test-tables.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ var people = [
3232
]
3333

3434
var con = new pg.Client({
35+
host: args.host,
36+
port: args.port,
3537
user: args.user,
3638
password: args.password,
3739
database: args.database

test/integration/connection/test-helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var connect = function(callback) {
99
console.log(error);
1010
throw new Error("Connection error");
1111
});
12-
con.connect('5432','localhost');
12+
con.connect(helper.args.port || '5432', helper.args.host || 'localhost');
1313
con.once('connect', function() {
1414
con.startup({
1515
user: username,

test/unit/client/test-helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require(__dirname+'/../test-helper');
1+
var helper = require(__dirname+'/../test-helper');
22
var Connection = require('connection');
33
var makeClient = function() {
44
var connection = new Connection({stream: "no"});
@@ -9,7 +9,7 @@ var makeClient = function() {
99
};
1010
connection.queries = [];
1111
var client = new Client({connection: connection});
12-
client.connect();
12+
client.connect(helper.args.port, helper.args.host);
1313
client.connection.emit('connect');
1414
return client;
1515
};

test/unit/test-helper.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ createClient = function() {
2323
client.connect();
2424
return client;
2525
};
26+
27+
module.exports = helper;

0 commit comments

Comments
 (0)