File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/event-handler/tests/unit/rest Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -104,16 +104,20 @@ describe('Class: BaseRouter', () => {
104104 } ) ;
105105
106106 it ( 'uses a custom logger when provided' , ( ) => {
107+ // Prepare
107108 vi . stubEnv ( 'AWS_LAMBDA_LOG_LEVEL' , 'DEBUG' ) ;
108-
109109 const logger = {
110110 debug : vi . fn ( ) ,
111111 info : vi . fn ( ) ,
112112 warn : vi . fn ( ) ,
113113 error : vi . fn ( ) ,
114114 } ;
115115
116- new TestResolver ( { logger } ) ;
116+ // Act
117+ const app = new TestResolver ( { logger } ) ;
118+ app . route ( ( ) => true , { path : '/' , method : 'get' } ) ;
119+
120+ // Assess
117121 expect ( logger . error ) . toHaveBeenCalledWith ( 'test error' ) ;
118122 expect ( logger . warn ) . toHaveBeenCalledWith ( 'test warn' ) ;
119123 expect ( logger . debug ) . toHaveBeenCalledWith ( 'test debug' ) ;
You can’t perform that action at this time.
0 commit comments