mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
I didn't do much to "modernize" the pg-native codebase other than running it through the standard eslint --fix that is applied to the rest of the code. There's some easy opportunities there to update it to es6 and so on...it still uses some pretty antiquated coding styles in places. This PR re-introduces the native tests on node v20, and updates test matrix to drop unsupported versions of node & add in node v22.
24 lines
603 B
JavaScript
24 lines
603 B
JavaScript
var Client = require('../')
|
|
var assert = require('assert')
|
|
|
|
describe('connection error', function () {
|
|
it('doesnt segfault', function (done) {
|
|
var client = new Client()
|
|
client.connect('asldgsdgasgdasdg', function (err) {
|
|
assert(err)
|
|
// calling error on a closed client was segfaulting
|
|
client.end()
|
|
done()
|
|
})
|
|
})
|
|
})
|
|
|
|
describe('reading while not connected', function () {
|
|
it('does not seg fault but does throw execption', function () {
|
|
var client = new Client()
|
|
assert.throws(function () {
|
|
client.on('notification', function (msg) {})
|
|
})
|
|
})
|
|
})
|