properly emit notice messages on client
This commit is contained in:
parent
ec158770f5
commit
5459773b90
@ -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() {
|
||||
|
11
test/integration/client/notice-tests.js
Normal file
11
test/integration/client/notice-tests.js
Normal 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();
|
||||
});
|
||||
})
|
Loading…
Reference in New Issue
Block a user