remove require.paths use
This commit is contained in:
parent
24b664efbd
commit
d9fbe9e878
@ -65,6 +65,12 @@ var ctor = function(config) {
|
||||
connection._namedQueries = {};
|
||||
connection._activeQuery = null;
|
||||
connection._config = utils.normalizeConnectionInfo(config);
|
||||
//attach properties to normalize interface with pure js client
|
||||
connection.user = connection._config.user;
|
||||
connection.password = connection._config.password;
|
||||
connection.database = connection._config.database;
|
||||
connection.host = connection._config.host;
|
||||
connection.port = connection._config.port;
|
||||
connection.on('connect', function() {
|
||||
connection._connected = true;
|
||||
connection._pulseQueryQueue(true);
|
||||
|
@ -1,5 +1,5 @@
|
||||
var helper = require(__dirname + '/test-helper');
|
||||
var pg = require("index");
|
||||
var pg = helper.pg;
|
||||
|
||||
test('default values', function() {
|
||||
assert.same(pg.defaults,{
|
||||
|
@ -1,6 +1,6 @@
|
||||
var net = require('net');
|
||||
var helper = require(__dirname+'/../test-helper');
|
||||
var Connection = require('connection');
|
||||
var Connection = require(__dirname + '/../../../lib/connection');
|
||||
var connect = function(callback) {
|
||||
var username = helper.args.user;
|
||||
var database = helper.args.database;
|
||||
|
@ -1,4 +1,3 @@
|
||||
require.paths.unshift(__dirname + '/../lib/');
|
||||
//make assert a global...
|
||||
assert = require('assert');
|
||||
|
||||
@ -6,7 +5,7 @@ var EventEmitter = require('events').EventEmitter;
|
||||
var sys = require('sys');
|
||||
var BufferList = require(__dirname+'/buffer-list')
|
||||
|
||||
var Connection = require('connection');
|
||||
var Connection = require(__dirname + '/../lib/connection');
|
||||
var args = require(__dirname + '/cli');
|
||||
|
||||
Client = require(__dirname + '/../lib').Client;
|
||||
@ -94,6 +93,9 @@ assert.empty = function(actual) {
|
||||
|
||||
assert.success = function(callback) {
|
||||
return assert.calls(function(err, arg) {
|
||||
if(err) {
|
||||
console.log(err);
|
||||
}
|
||||
assert.isNull(err);
|
||||
callback(arg);
|
||||
})
|
||||
@ -214,7 +216,7 @@ var Sink = function(expected, timeout, callback) {
|
||||
module.exports = {
|
||||
args: args,
|
||||
Sink: Sink,
|
||||
pg: require('index'),
|
||||
pg: require(__dirname + '/../lib/'),
|
||||
connectionString: function() {
|
||||
return "pg"+(count++)+"://"+args.user+":"+args.password+"@"+args.host+":"+args.port+"/"+args.database;
|
||||
},
|
||||
|
@ -1,5 +1,5 @@
|
||||
var helper = require(__dirname + '/test-helper');
|
||||
var Connection = require('connection');
|
||||
var Connection = require(__dirname + '/../../../lib/connection');
|
||||
var con = new Connection({stream: "NO"});
|
||||
var client = new Client({connection:con});
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
var helper = require(__dirname+'/../test-helper');
|
||||
var Connection = require('connection');
|
||||
var Connection = require(__dirname + '/../../../lib/connection');
|
||||
var makeClient = function() {
|
||||
var connection = new Connection({stream: "no"});
|
||||
connection.startup = function() {};
|
||||
|
@ -1,5 +1,5 @@
|
||||
var helper = require(__dirname + '/test-helper');
|
||||
var Connection = require('connection');
|
||||
var Connection = require(__dirname + '/../../../lib/connection');
|
||||
var con = new Connection({stream: new MemoryStream()});
|
||||
test("connection emits stream errors", function() {
|
||||
assert.emits(con, 'error', function(err) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
require(__dirname+'/test-helper');
|
||||
var Connection = require('connection');
|
||||
var Connection = require(__dirname + '/../../../lib/connection');
|
||||
var buffers = require(__dirname + '/../../test-buffers');
|
||||
var PARSE = function(buffer) {
|
||||
return new Parser(buffer).parse();
|
||||
|
@ -1,5 +1,5 @@
|
||||
require(__dirname + "/test-helper");
|
||||
var Connection = require('connection');
|
||||
var Connection = require(__dirname + '/../../../lib/connection');
|
||||
var stream = new MemoryStream();
|
||||
var con = new Connection({
|
||||
stream: stream
|
||||
|
@ -1,5 +1,5 @@
|
||||
require(__dirname+'/test-helper');
|
||||
var Connection = require('connection');
|
||||
var Connection = require(__dirname + '/../../../lib/connection');
|
||||
test('connection can take existing stream', function() {
|
||||
var stream = new MemoryStream();
|
||||
var con = new Connection({stream: stream});
|
||||
|
@ -1,6 +1,6 @@
|
||||
var helper = require(__dirname+'/../test-helper');
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var Connection = require('connection');
|
||||
var Connection = require(__dirname + '/../../lib/connection');
|
||||
MemoryStream = function() {
|
||||
EventEmitter.call(this);
|
||||
this.packets = [];
|
||||
|
Loading…
Reference in New Issue
Block a user