node-postgres/test/integration/client/deprecation-tests.js
2017-06-20 09:28:44 -05:00

24 lines
516 B
JavaScript

var helper = require('./test-helper')
process.on('warning', function (warning) {
console.log(warning)
throw new Error('Should not emit deprecation warning')
})
var client = new helper.pg.Client()
client.connect(function (err) {
if (err) throw err
client.query('SELECT NOW()')
.then(function (res) {
client.query('SELECT NOW()', function () {
client.end(function () {
})
})
}).catch(function (err) {
setImmediate(function () {
throw err
})
})
})