2020-04-10 11:31:03 -05:00

23 lines
599 B
JavaScript

const assert = require('assert')
const helper = require('./helper')
const QueryStream = require('../')
helper('empty-query', function (client) {
it('handles empty query', function (done) {
const stream = new QueryStream('-- this is a comment', [])
const query = client.query(stream)
query
.on('end', function () {
// nothing should happen for empty query
done()
})
.on('data', function () {
// noop to kick off reading
})
})
it('continues to function after stream', function (done) {
client.query('SELECT NOW()', done)
})
})