basic test for client error handling

This commit is contained in:
brianc 2010-10-26 01:51:12 -05:00
parent 6699cccafe
commit b5d02a995a
2 changed files with 14 additions and 0 deletions

View File

@ -61,6 +61,10 @@ p.connect = function() {
self.pulseQueryQueue();
});
con.on('error', function(error) {
self.emit('error', error);
});
};
p.pulseQueryQueue = function() {

View File

@ -0,0 +1,10 @@
var helper = require(__dirname + '/test-helper');
test('error handling', function(){
var client = helper.client();
client.query("select omfg from yodas_soda where pixistix = 'zoiks!!!'");
assert.raises(client, 'error', function(error) {
assert.equal(error.severity, "ERROR");
client.end();
});
});