@@ -258,6 +258,7 @@ test('fastify.pg.test use transact util with promise', t => {
258
258
t . plan ( 3 )
259
259
260
260
const fastify = Fastify ( )
261
+ t . tearDown ( fastify . close . bind ( fastify ) )
261
262
262
263
fastify . register ( fastifyPostgres , {
263
264
name : 'test' ,
@@ -274,15 +275,12 @@ test('fastify.pg.test use transact util with promise', t => {
274
275
. query ( `SELECT * FROM users WHERE username = 'with-promise'` )
275
276
. then ( result => {
276
277
t . ok ( result . rows [ 0 ] . username === 'with-promise' )
277
- fastify . close ( )
278
278
} ) . catch ( err => {
279
279
t . fail ( err )
280
- fastify . close ( )
281
280
} )
282
281
} )
283
282
. catch ( err => {
284
283
t . fail ( err )
285
- fastify . close ( )
286
284
} )
287
285
} )
288
286
} )
@@ -291,6 +289,7 @@ test('fastify.pg.test use transact util with callback', t => {
291
289
t . plan ( 4 )
292
290
293
291
const fastify = Fastify ( )
292
+ t . tearDown ( fastify . close . bind ( fastify ) )
294
293
295
294
fastify . register ( fastifyPostgres , {
296
295
name : 'test' ,
@@ -309,10 +308,8 @@ test('fastify.pg.test use transact util with callback', t => {
309
308
. query ( `SELECT * FROM users WHERE username = 'with-callback'` )
310
309
. then ( result => {
311
310
t . ok ( result . rows [ 0 ] . username === 'with-callback' )
312
- fastify . close ( )
313
311
} ) . catch ( err => {
314
312
t . fail ( err )
315
- fastify . close ( )
316
313
} )
317
314
} )
318
315
} )
@@ -322,6 +319,7 @@ test('fastify.pg.test use transact util with commit callback', t => {
322
319
t . plan ( 4 )
323
320
324
321
const fastify = Fastify ( )
322
+ t . tearDown ( fastify . close . bind ( fastify ) )
325
323
326
324
fastify . register ( fastifyPostgres , {
327
325
name : 'test' ,
@@ -343,10 +341,8 @@ test('fastify.pg.test use transact util with commit callback', t => {
343
341
. query ( `SELECT * FROM users WHERE username = 'commit-callback'` )
344
342
. then ( result => {
345
343
t . ok ( result . rows [ 0 ] . username === 'commit-callback' )
346
- fastify . close ( )
347
344
} ) . catch ( err => {
348
345
t . fail ( err )
349
- fastify . close ( )
350
346
} )
351
347
} )
352
348
} )
0 commit comments