node-postgres/test/logging.js
Brian C 9ab7aff029 Update code to run on >=0.10.0 (#17)
* Replace const with var

* Update code to run on 0.10.x +

* Lint
2016-07-03 18:17:34 -05:00

21 lines
497 B
JavaScript

var expect = require('expect.js')
var describe = require('mocha').describe
var it = require('mocha').it
var Pool = require('../')
describe('logging', function () {
it('logs to supplied log function if given', function () {
var messages = []
var log = function (msg) {
messages.push(msg)
}
var pool = new Pool({ log: log })
return pool.query('SELECT NOW()').then(function () {
expect(messages.length).to.be.greaterThan(0)
return pool.end()
})
})
})