Skip to content

Commit dd76bf7

Browse files
committed
feat: add test for new error
1 parent d514dd8 commit dd76bf7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/pg/test/unit/client/simple-query-tests.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,17 @@ test('executing query', function () {
140140
)
141141
}
142142
})
143+
144+
test('throws an error when callback is not a function', function () {
145+
try {
146+
client.query('SELECT $1', [1], 'notafunction')
147+
} catch (error) {
148+
assert.equal(
149+
error.message,
150+
'callback is not a function',
151+
'Should have thrown an Error for non function callback'
152+
)
153+
}
154+
})
143155
})
144156
})

0 commit comments

Comments
 (0)