node-postgres/test/integration/connection-pool/optional-config-tests.js
Brian C 796a44f54f Remove internal pool (#1049)
* Initial work on removing internal pool

* Port backwards-compabible properties

* Cleanup test execution & makefile cruft

* Attempt to fix flakey error test
2016-06-21 09:53:09 -05:00

21 lines
577 B
JavaScript

var helper = require(__dirname + '/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);
});
}));