mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
basic test for client error handling
This commit is contained in:
parent
6699cccafe
commit
b5d02a995a
@ -61,6 +61,10 @@ p.connect = function() {
|
||||
|
||||
self.pulseQueryQueue();
|
||||
});
|
||||
|
||||
con.on('error', function(error) {
|
||||
self.emit('error', error);
|
||||
});
|
||||
};
|
||||
|
||||
p.pulseQueryQueue = function() {
|
||||
|
||||
10
test/integration/client/error-handling-tests.js
Normal file
10
test/integration/client/error-handling-tests.js
Normal 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();
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user