mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
23 lines
610 B
JavaScript
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);
|
|
});
|
|
});
|