Fixes for testing with non-local Postgres server.
This commit is contained in:
parent
d58fa16a6d
commit
6dd0157280
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -23,3 +23,5 @@ createClient = function() {
|
||||
client.connect();
|
||||
return client;
|
||||
};
|
||||
|
||||
module.exports = helper;
|
||||
|
Loading…
Reference in New Issue
Block a user