mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
* Add client connectionString tests (#1310) * Remove redundant tests * Add client connectionString test Add test to ensure { connectionString } is respected as an argument to the client constructor * Add test for connection string property Also fixed some legacy require statements. * Normalize native error properties Map native error properties to the same property names we use for errors from the JS driver. Fixes #972 Fixes #938
21 lines
566 B
JavaScript
21 lines
566 B
JavaScript
var helper = require('./test-helper');
|
|
|
|
//setup defaults
|
|
helper.pg.defaults.user = helper.args.user;
|
|
helper.pg.defaults.password = helper.args.password;
|
|
helper.pg.defaults.host = helper.args.host;
|
|
helper.pg.defaults.port = helper.args.port;
|
|
helper.pg.defaults.database = helper.args.database;
|
|
helper.pg.defaults.poolSize = 1;
|
|
|
|
helper.pg.connect(assert.calls(function(err, client, done) {
|
|
assert.isNull(err);
|
|
client.query('SELECT NOW()');
|
|
client.once('drain', function() {
|
|
setTimeout(function() {
|
|
helper.pg.end();
|
|
done();
|
|
}, 10);
|
|
});
|
|
}));
|