Fixes for testing with non-local Postgres server.

This commit is contained in:
Aleksey Zhukov 2011-07-20 01:55:39 +04:00
parent d58fa16a6d
commit 6dd0157280
4 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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,

View File

@ -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;
};

View File

@ -23,3 +23,5 @@ createClient = function() {
client.connect();
return client;
};
module.exports = helper;