@@ -8,9 +8,7 @@ const fastify = require('fastify')
88test ( 'decorators get added' , ( t ) => {
99 t . plan ( 1 )
1010 const instance = fastify ( )
11- instance . register ( plugin , ( err ) => {
12- if ( err ) t . threw ( err )
13- } )
11+ instance . register ( plugin )
1412 instance . get ( '/' , ( req , reply ) => {
1513 t . ok ( reply . etag )
1614 reply . send ( )
@@ -28,9 +26,7 @@ test('decorators add headers', (t) => {
2826 t . plan ( 2 )
2927 const tag = '123456'
3028 const instance = fastify ( )
31- instance . register ( plugin , ( err ) => {
32- if ( err ) t . threw ( err )
33- } )
29+ instance . register ( plugin )
3430 instance . get ( '/' , ( req , reply ) => {
3531 reply
3632 . etag ( tag )
@@ -51,9 +47,7 @@ test('decorators add headers', (t) => {
5147test ( 'sets no-cache header' , ( t ) => {
5248 t . plan ( 2 )
5349 const instance = fastify ( )
54- instance . register ( plugin , { privacy : plugin . privacy . NOCACHE } , ( err ) => {
55- if ( err ) t . threw ( err )
56- } )
50+ instance . register ( plugin , { privacy : plugin . privacy . NOCACHE } )
5751 instance . get ( '/' , ( req , reply ) => {
5852 reply . send ( { hello : 'world' } )
5953 } )
@@ -77,9 +71,7 @@ test('sets private with max-age header', (t) => {
7771 privacy : plugin . privacy . PRIVATE ,
7872 expiresIn : 300
7973 }
80- instance . register ( plugin , opts , ( err ) => {
81- if ( err ) t . threw ( err )
82- } )
74+ instance . register ( plugin , opts )
8375 instance . get ( '/' , ( req , reply ) => {
8476 reply . send ( { hello : 'world' } )
8577 } )
@@ -99,9 +91,7 @@ test('sets private with max-age header', (t) => {
9991test ( 'sets no-store with max-age header' , ( t ) => {
10092 t . plan ( 2 )
10193 const instance = fastify ( )
102- instance . register ( plugin , { privacy : 'no-store' , expiresIn : 300 } , ( err ) => {
103- if ( err ) t . threw ( err )
104- } )
94+ instance . register ( plugin , { privacy : 'no-store' , expiresIn : 300 } )
10595 instance . get ( '/' , ( req , reply ) => {
10696 reply . send ( { hello : 'world' } )
10797 } )
@@ -122,9 +112,7 @@ test('sets the expires header', (t) => {
122112 t . plan ( 2 )
123113 const now = new Date ( )
124114 const instance = fastify ( )
125- instance . register ( plugin , { privacy : plugin . privacy . NOCACHE } , ( err ) => {
126- if ( err ) t . threw ( err )
127- } )
115+ instance . register ( plugin , { privacy : plugin . privacy . NOCACHE } )
128116 instance . get ( '/' , ( req , reply ) => {
129117 reply
130118 . expires ( now )
0 commit comments