1 |
|
2 | const expect = require('expect.js')
|
3 |
|
4 | const describe = require('mocha').describe
|
5 | const it = require('mocha').it
|
6 |
|
7 | const Pool = require('../')
|
8 |
|
9 | describe('verify', () => {
|
10 | it('verifies a client with a callback', (done) => {
|
11 | const pool = new Pool({
|
12 | verify: (client, cb) => {
|
13 | cb(new Error('nope'))
|
14 | },
|
15 | })
|
16 |
|
17 | pool.connect((err, client) => {
|
18 | expect(err).to.be.an(Error)
|
19 | expect(err.message).to.be('nope')
|
20 | pool.end()
|
21 | done()
|
22 | })
|
23 | })
|
24 | })
|