UNPKG

532 BJavaScriptView Raw
1'use strict'
2const Cursor = require('pg-cursor')
3const expect = require('expect.js')
4const describe = require('mocha').describe
5const it = require('mocha').it
6
7const Pool = require('../')
8
9describe('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})