2020-04-10 10:34:34 -05:00

23 lines
610 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);
});
});