@@ -2,6 +2,7 @@ import context from '@aws-lambda-powertools/testing-utils/context';
2
2
import type { Context } from 'aws-lambda' ;
3
3
import { beforeEach , describe , expect , it , vi } from 'vitest' ;
4
4
import { BaseRouter } from '../../../src/rest/BaseRouter.js' ;
5
+ import { HttpVerbs } from '../../../src/rest/constatnts.js' ;
5
6
import type { ResolveOptions } from '../../../src/types/index.js' ;
6
7
import type {
7
8
HttpMethod ,
@@ -81,8 +82,8 @@ describe('Class: BaseRouter', () => {
81
82
it ( 'uses the global console when no logger is not provided' , ( ) => {
82
83
// Act
83
84
const app = new TestResolver ( ) ;
84
- app . route ( ( ) => true , { path : '/' , method : 'get' } ) ;
85
-
85
+ app . route ( ( ) => true , { path : '/' , method : HttpVerbs . GET } ) ;
86
+
86
87
// Assess
87
88
expect ( console . debug ) . not . toHaveBeenCalled ( ) ;
88
89
expect ( console . error ) . toHaveBeenCalledWith ( 'test error' ) ;
@@ -92,11 +93,11 @@ describe('Class: BaseRouter', () => {
92
93
it ( 'emits debug logs using global console when the log level is set to `DEBUG` and a logger is not provided' , ( ) => {
93
94
// Prepare
94
95
vi . stubEnv ( 'AWS_LAMBDA_LOG_LEVEL' , 'DEBUG' ) ;
95
-
96
+
96
97
// Act
97
98
const app = new TestResolver ( ) ;
98
- app . route ( ( ) => true , { path : '/' , method : 'get' } ) ;
99
-
99
+ app . route ( ( ) => true , { path : '/' , method : HttpVerbs . GET } ) ;
100
+
100
101
// Assess
101
102
expect ( console . debug ) . toHaveBeenCalledWith ( 'test debug' ) ;
102
103
expect ( console . error ) . toHaveBeenCalledWith ( 'test error' ) ;
@@ -115,8 +116,8 @@ describe('Class: BaseRouter', () => {
115
116
116
117
// Act
117
118
const app = new TestResolver ( { logger } ) ;
118
- app . route ( ( ) => true , { path : '/' , method : 'get' } ) ;
119
-
119
+ app . route ( ( ) => true , { path : '/' , method : HttpVerbs . GET } ) ;
120
+
120
121
// Assess
121
122
expect ( logger . error ) . toHaveBeenCalledWith ( 'test error' ) ;
122
123
expect ( logger . warn ) . toHaveBeenCalledWith ( 'test warn' ) ;
0 commit comments