From 9281ff98605122628268130ce95e1f731a18ce41 Mon Sep 17 00:00:00 2001 From: Brian Carlson Date: Thu, 16 Dec 2010 23:48:58 -0600 Subject: [PATCH] failing test for query errors not being trapped in callback --- test/integration/client/api-tests.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/integration/client/api-tests.js b/test/integration/client/api-tests.js index 22af61a2..ff05b9b8 100644 --- a/test/integration/client/api-tests.js +++ b/test/integration/client/api-tests.js @@ -64,3 +64,12 @@ test('raises error if cannot connect', function() { assert.ok(err, 'should have raised an error') })) }) + +test("query errors are handled and do not bubble if callbac is provded", function() { + pg.connect(connectionString, assert.calls(function(err, client) { + assert.isNull(err) + client.query("SELECT OISDJF FROM LEIWLISEJLSE", assert.calls(function(err, result) { + assert.ok(err); + })) + })) +})