node-postgres/test/integration/client/empty-query-tests.js

18 lines
430 B
JavaScript
Raw Normal View History

2010-10-30 09:33:53 +08:00
var helper = require(__dirname+'/test-helper');
var client = helper.client();
test("empty query message handling", function() {
assert.emits(client, 'drain', function() {
2011-03-04 02:23:02 +08:00
client.end();
});
client.query({text: "", binary: false});
2010-10-30 09:33:53 +08:00
});
test('callback supported', assert.calls(function() {
client.query({text: "", binary: false}, function(err, result) {
assert.isNull(err);
assert.empty(result.rows);
})
}))