mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
integration test for notifications
This commit is contained in:
parent
09d8e5d1e7
commit
1b56e708e9
15
test/integration/connection/notification-tests.js
Normal file
15
test/integration/connection/notification-tests.js
Normal file
@ -0,0 +1,15 @@
|
||||
var helper = require(__dirname + '/test-helper');
|
||||
//http://www.postgresql.org/docs/8.3/static/libpq-notify.html
|
||||
test('recieves notification from same connection with no payload', function() {
|
||||
helper.connect(function(con) {
|
||||
con.query('LISTEN boom');
|
||||
assert.raises(con, 'readyForQuery', function() {
|
||||
con.query("NOTIFY boom");
|
||||
assert.raises(con, 'notificationResponse', function(msg) {
|
||||
assert.equal(msg.payload, "");
|
||||
assert.equal(msg.channel, 'boom')
|
||||
con.end();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user