node-postgres/test/integration/connection-pool/ending-pool-tests.js
Alexander Sulfrian f698ed4459 use config dict in all test
instead of the connection string use the config dict in all tests to
be able to specify things like binary mode
2011-11-22 05:00:54 +01:00

24 lines
666 B
JavaScript

var helper = require(__dirname + '/test-helper')
var called = false;
test('disconnects', function() {
var sink = new helper.Sink(4, function() {
called = true;
//this should exit the process, killing each connection pool
helper.pg.end();
});
[helper.config, helper.config, helper.config, helper.config].forEach(function(config) {
helper.pg.connect(config, function(err, client) {
assert.isNull(err);
client.query("SELECT * FROM NOW()", function(err, result) {
process.nextTick(function() {
assert.equal(called, false, "Should not have disconnected yet")
sink.add();
})
})
})
})
})