properly emit notice messages on client

This commit is contained in:
brianc 2011-03-03 23:30:17 +00:00
parent ec158770f5
commit 5459773b90
2 changed files with 16 additions and 3 deletions

View File

@ -23,9 +23,6 @@ var Client = function(config) {
this.password = config.password || defaults.password;
this.encoding = 'utf8';
var self = this;
this.connection.on('notify', function(msg) {
self.emit('notify', msg);
})
};
sys.inherits(Client, EventEmitter);
@ -111,6 +108,11 @@ p.connect = function() {
self.activeQuery = null;
}
});
con.on('notice', function(msg) {
self.emit('notice', msg);
})
};
p._pulseQueryQueue = function() {

View File

@ -0,0 +1,11 @@
var helper = require(__dirname + '/test-helper');
test('emits notice message', function() {
var client = helper.client();
client.query('create temp table boom(id serial, size integer)');
assert.emits(client, 'notice', function(notice) {
assert.ok(notice != null);
client.end();
});
})