You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
529 B
26 lines
529 B
3 years ago
|
'use strict'
|
||
|
const expect = require('expect.js')
|
||
|
|
||
|
const describe = require('mocha').describe
|
||
|
const it = require('mocha').it
|
||
|
|
||
|
const Pool = require('../')
|
||
|
|
||
|
describe('verify', () => {
|
||
|
it('verifies a client with a callback', false, (done) => {
|
||
|
const pool = new Pool({
|
||
|
verify: (client, cb) => {
|
||
|
client.release()
|
||
|
cb(new Error('nope'))
|
||
|
},
|
||
|
})
|
||
|
|
||
|
pool.connect((err, client) => {
|
||
|
expect(err).to.be.an(Error)
|
||
|
expect(err.message).to.be('nope')
|
||
|
pool.end()
|
||
|
done()
|
||
|
})
|
||
|
})
|
||
|
})
|