From 1b56e708e9f6df8b74241c408d87ea079ac6e73c Mon Sep 17 00:00:00 2001 From: brianc Date: Sat, 23 Oct 2010 23:12:02 -0500 Subject: [PATCH] integration test for notifications --- test/integration/connection/notification-tests.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/integration/connection/notification-tests.js diff --git a/test/integration/connection/notification-tests.js b/test/integration/connection/notification-tests.js new file mode 100644 index 00000000..9d229414 --- /dev/null +++ b/test/integration/connection/notification-tests.js @@ -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(); + }); + }); + }); +});