submittable.js 532 B

1234567891011121314151617181920
  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. const Pool = require('../')
  7. describe('submittle', () => {
  8. it('is returned from the query method', false, (done) => {
  9. const pool = new Pool()
  10. const cursor = pool.query(new Cursor('SELECT * from generate_series(0, 1000)'))
  11. cursor.read((err, rows) => {
  12. expect(err).to.be(undefined)
  13. expect(!!rows).to.be.ok()
  14. cursor.close(done)
  15. })
  16. })
  17. })