1 | 'use strict'
|
2 | const Cursor = require('pg-cursor')
|
3 | const expect = require('expect.js')
|
4 | const describe = require('mocha').describe
|
5 | const it = require('mocha').it
|
6 |
|
7 | const Pool = require('../')
|
8 |
|
9 | describe('submittle', () => {
|
10 | it('is returned from the query method', false, (done) => {
|
11 | const pool = new Pool()
|
12 | const cursor = pool.query(new Cursor('SELECT * from generate_series(0, 1000)'))
|
13 | cursor.read((err, rows) => {
|
14 | expect(err).to.be(undefined)
|
15 | expect(!!rows).to.be.ok()
|
16 | cursor.close(done)
|
17 | })
|
18 | })
|
19 | })
|