UNPKG

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