Brian C fe88e825e5
Add pg-native to monorepo (#3225)
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.
2024-06-04 10:26:11 -05:00

27 lines
646 B
JavaScript

var Client = require('../')
var async = require('async')
var assert = require('assert')
describe('many errors', function () {
it('functions properly without segfault', function (done) {
var throwError = function (n, cb) {
var client = new Client()
client.connectSync()
var doIt = function (n, cb) {
client.query('select asdfiasdf', function (err) {
assert(err, 'bad query should emit an error')
cb(null)
})
}
async.timesSeries(10, doIt, function (err) {
if (err) return cb(err)
client.end(cb)
})
}
async.times(10, throwError, done)
})
})