mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
18 lines
442 B
JavaScript
18 lines
442 B
JavaScript
var helper = require(__dirname+"/test-helper");
|
|
//before running this test make sure you run the script create-test-tables
|
|
test("selects rows", function() {
|
|
var client = helper.client();
|
|
client.connect();
|
|
var query = client.query("select * from person");
|
|
var rowCount = 0;
|
|
query.on('row', function(row) {
|
|
rowCount++;
|
|
});
|
|
assert.raises(query, 'end', function() {
|
|
assert.equal(rowCount, 26);
|
|
client.end();
|
|
});
|
|
|
|
|
|
});
|