@@ -18,13 +18,13 @@ test('When we use the fastify-postgres transaction route option', async t => {
1818
1919 await fastify . pg . query ( 'DELETE FROM "users" WHERE TRUE' )
2020
21- fastify . get ( '/count-users' , async ( req , reply ) => {
21+ fastify . get ( '/count-users' , async ( ) => {
2222 const result = await fastify . pg . query ( 'SELECT COUNT(*) AS "userCount" FROM users WHERE username=\'pass-opt-in\'' )
2323
2424 return result
2525 } )
2626
27- fastify . get ( '/pass' , { pg : { transact : true } } , async ( req , reply ) => {
27+ fastify . get ( '/pass' , { pg : { transact : true } } , async ( req ) => {
2828 await req . pg . query ( 'INSERT INTO users(username) VALUES($1) RETURNING id' , [ 'pass-opt-in' ] )
2929 await req . pg . query ( 'INSERT INTO users(username) VALUES($1) RETURNING id' , [ 'pass-opt-in' ] )
3030 return 'complete'
@@ -51,13 +51,13 @@ test('When we use the fastify-postgres transaction route option', async t => {
5151
5252 await fastify . pg . test . query ( 'DELETE FROM "users" WHERE TRUE' )
5353
54- fastify . get ( '/count-users' , async ( req , reply ) => {
54+ fastify . get ( '/count-users' , async ( ) => {
5555 const result = await fastify . pg . test . query ( 'SELECT COUNT(*) AS "userCount" FROM users WHERE username=\'pass-opt-in\'' )
5656
5757 return result
5858 } )
5959
60- fastify . get ( '/pass' , { pg : { transact : 'test' } } , async ( req , reply ) => {
60+ fastify . get ( '/pass' , { pg : { transact : 'test' } } , async ( req ) => {
6161 await req . pg . test . query ( 'INSERT INTO users(username) VALUES($1) RETURNING id' , [ 'pass-opt-in' ] )
6262 await req . pg . test . query ( 'INSERT INTO users(username) VALUES($1) RETURNING id' , [ 'pass-opt-in' ] )
6363
@@ -84,7 +84,7 @@ test('When we use the fastify-postgres transaction route option', async t => {
8484
8585 await fastify . pg . query ( 'DELETE FROM "users" WHERE TRUE' )
8686
87- fastify . get ( '/count-users' , async ( req , reply ) => {
87+ fastify . get ( '/count-users' , async ( _req , reply ) => {
8888 const result = await fastify . pg . query ( 'SELECT COUNT(*) AS "userCount" FROM users WHERE username=\'fail-opt-in\'' )
8989
9090 reply . send ( result )
@@ -119,7 +119,7 @@ test('When we use the fastify-postgres transaction route option', async t => {
119119
120120 await fastify . pg . test . query ( 'DELETE FROM "users" WHERE TRUE' )
121121
122- fastify . get ( '/count-users' , async ( req , reply ) => {
122+ fastify . get ( '/count-users' , async ( _req , reply ) => {
123123 const result = await fastify . pg . test . query ( 'SELECT COUNT(*) AS "userCount" FROM users WHERE username=\'fail-opt-in\'' )
124124
125125 reply . send ( result )
@@ -162,7 +162,7 @@ test('When we use the fastify-postgres transaction route option', async t => {
162162 }
163163 } ,
164164 pg : { transact : true }
165- } , async ( req , reply ) => {
165+ } , async ( ) => {
166166 t . assert . fail ( 'should never execute the handler' )
167167 } )
168168
@@ -186,7 +186,7 @@ test('Should not add hooks with combinations of registration `options.name` and
186186 await fastify . register ( fastifyPostgres , {
187187 connectionString
188188 } )
189- fastify . get ( '/' , async ( req , reply ) => {
189+ fastify . get ( '/' , async ( req ) => {
190190 t . assert . strictEqual ( req . pg , null )
191191 } )
192192 await fastify . inject ( { url : '/' } )
@@ -202,7 +202,7 @@ test('Should not add hooks with combinations of registration `options.name` and
202202 connectionString,
203203 name : 'test'
204204 } )
205- fastify . get ( '/' , async ( req , reply ) => {
205+ fastify . get ( '/' , async ( req ) => {
206206 t . assert . strictEqual ( req . pg , null )
207207 } )
208208
@@ -219,7 +219,7 @@ test('Should not add hooks with combinations of registration `options.name` and
219219 connectionString,
220220 name : 'test'
221221 } )
222- fastify . get ( '/' , { pg : { transact : true } } , async ( req , reply ) => {
222+ fastify . get ( '/' , { pg : { transact : true } } , async ( req ) => {
223223 t . assert . strictEqual ( req . pg , null )
224224 } )
225225
@@ -235,7 +235,7 @@ test('Should not add hooks with combinations of registration `options.name` and
235235 await fastify . register ( fastifyPostgres , {
236236 connectionString
237237 } )
238- fastify . get ( '/' , { pg : { transact : 'test' } } , async ( req , reply ) => {
238+ fastify . get ( '/' , { pg : { transact : 'test' } } , async ( req ) => {
239239 t . assert . strictEqual ( req . pg , null )
240240 } )
241241
@@ -252,7 +252,7 @@ test('Should not add hooks with combinations of registration `options.name` and
252252 connectionString,
253253 name : 'test'
254254 } )
255- fastify . get ( '/' , { pg : { transact : 'different' } } , async ( req , reply ) => {
255+ fastify . get ( '/' , { pg : { transact : 'different' } } , async ( req ) => {
256256 t . assert . strictEqual ( req . pg , null )
257257 } )
258258
@@ -272,7 +272,7 @@ test('Should throw errors with incorrect combinations of registration `options.n
272272 name
273273 } )
274274
275- fastify . get ( '/' , { pg : { transact : name } } , async ( req , reply ) => { } )
275+ fastify . get ( '/' , { pg : { transact : name } } , async ( ) => { } )
276276
277277 const response = await fastify . inject ( { url : '/' } )
278278 t . assert . deepStrictEqual ( response . json ( ) , {
@@ -292,10 +292,10 @@ test('Should throw errors with incorrect combinations of registration `options.n
292292 connectionString,
293293 name
294294 } )
295- fastify . addHook ( 'onRequest' , async ( req , reply ) => {
295+ fastify . addHook ( 'onRequest' , async ( req ) => {
296296 req . pg = { [ name ] : await fastify . pg [ name ] . connect ( ) }
297297 } )
298- fastify . get ( '/' , { pg : { transact : name } } , async ( req , reply ) => { } )
298+ fastify . get ( '/' , { pg : { transact : name } } , async ( ) => { } )
299299
300300 const response = await fastify . inject ( { url : '/' } )
301301 t . assert . deepStrictEqual ( response . json ( ) , {
@@ -312,10 +312,10 @@ test('Should throw errors with incorrect combinations of registration `options.n
312312 await fastify . register ( fastifyPostgres , {
313313 connectionString
314314 } )
315- fastify . addHook ( 'onRequest' , async ( req , reply ) => {
315+ fastify . addHook ( 'onRequest' , async ( req ) => {
316316 req . pg = await fastify . pg . connect ( )
317317 } )
318- fastify . get ( '/' , { pg : { transact : true } } , async ( req , reply ) => { } )
318+ fastify . get ( '/' , { pg : { transact : true } } , async ( ) => { } )
319319
320320 const response = await fastify . inject ( { url : '/' } )
321321 t . assert . deepStrictEqual ( response . json ( ) , {
0 commit comments