mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
add failing test for noData queries
This commit is contained in:
parent
f7b6572399
commit
9cc3e527da
25
test/no-data-handling.js
Normal file
25
test/no-data-handling.js
Normal file
@ -0,0 +1,25 @@
|
||||
var assert = require('assert')
|
||||
var pg = require('pg.js');
|
||||
var Cursor = require('../');
|
||||
|
||||
describe('queries with no data', function () {
|
||||
beforeEach(function(done) {
|
||||
var client = this.client = new pg.Client()
|
||||
client.connect(done)
|
||||
})
|
||||
|
||||
|
||||
afterEach(function() {
|
||||
this.client.end()
|
||||
})
|
||||
|
||||
it('handles queries that return no data', function (done) {
|
||||
var cursor = new Cursor('CREATE TEMPORARY TABLE whatwhat (thing int)')
|
||||
this.client.query(cursor)
|
||||
cursor.read(100, function (err, rows) {
|
||||
assert.ifError(err)
|
||||
assert.equal(rows.length, 0)
|
||||
done()
|
||||
})
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user