@@ -12,9 +12,7 @@ describe("LambdaUtils", () => {
1212
1313 test ( "wrapApiHandler apiSuccess" , ( endTest ) => {
1414 // GIVEN
15- const expectResult = { hello : 'world' } ;
16-
17- const handler = LambdaUtils . wrapApiHandler ( async ( event : APIGatewayEvent ) : Promise < APIGatewayProxyResult > => {
15+ const handler = LambdaUtils . wrapApiHandler ( async ( event : LambdaUtils . APIGatewayProxyEvent ) : Promise < APIGatewayProxyResult > => {
1816 // Echo the event back
1917 return LambdaUtils . apiSuccess ( event ) ;
2018 } ) ;
@@ -52,10 +50,10 @@ describe("LambdaUtils", () => {
5250 expect ( resultEvent . body ) . toEqual ( body ) ;
5351
5452 // Headers are normalized in request event
55- expect ( resultEvent . headers [ 'content-length ' ] ) . toBeUndefined ( ) ;
56- expect ( resultEvent . headers [ 'Content-Length ' ] ) . toEqual ( '0' ) ;
53+ expect ( resultEvent . headers [ 'Content-Length ' ] ) . toBeUndefined ( ) ;
54+ expect ( resultEvent . headers [ 'content-length ' ] ) . toEqual ( '0' ) ;
5755 expect ( resultEvent . headers [ "CONTENT-TYPE" ] ) . toBeUndefined ( ) ;
58- expect ( resultEvent . headers [ 'Content-Type ' ] ) . toEqual ( "application/json" ) ;
56+ expect ( resultEvent . headers [ 'content-type ' ] ) . toEqual ( "application/json" ) ;
5957
6058 // pathParameters and queryStringParameters are expanded to empty objects
6159 expect ( resultEvent . pathParameters ) . toEqual ( { } ) ;
@@ -67,9 +65,7 @@ describe("LambdaUtils", () => {
6765
6866 test ( "wrapApiHandler promise object success" , ( endTest ) => {
6967 // GIVEN
70- const expectResult = { hello : 'world' } ;
71-
72- const handler = LambdaUtils . wrapApiHandler ( async ( event : APIGatewayEvent ) : Promise < any > => {
68+ const handler = LambdaUtils . wrapApiHandler ( async ( ) : Promise < any > => {
7369 return { message : 'Hello' } ;
7470 } ) ;
7571
@@ -103,9 +99,7 @@ describe("LambdaUtils", () => {
10399
104100 test ( "wrapApiHandler promise empty success" , ( endTest ) => {
105101 // GIVEN
106- const expectResult = { hello : 'world' } ;
107-
108- const handler = LambdaUtils . wrapApiHandler ( async ( event : APIGatewayEvent ) : Promise < any > => {
102+ const handler = LambdaUtils . wrapApiHandler ( async ( ) : Promise < any > => {
109103 return ;
110104 } ) ;
111105
@@ -139,7 +133,7 @@ describe("LambdaUtils", () => {
139133
140134 test ( "wrapApiHandler throw Error" , ( endTest ) => {
141135 // GIVEN
142- const handler = LambdaUtils . wrapApiHandler ( async ( event : APIGatewayEvent ) : Promise < APIGatewayProxyResult > => {
136+ const handler = LambdaUtils . wrapApiHandler ( async ( ) : Promise < APIGatewayProxyResult > => {
143137 throw new Error ( "oops" ) ;
144138 } ) ;
145139
@@ -157,7 +151,7 @@ describe("LambdaUtils", () => {
157151
158152 test ( "wrapApiHandler throw http-error" , ( endTest ) => {
159153 // GIVEN
160- const handler = LambdaUtils . wrapApiHandler ( async ( event : APIGatewayEvent ) : Promise < APIGatewayProxyResult > => {
154+ const handler = LambdaUtils . wrapApiHandler ( async ( ) : Promise < APIGatewayProxyResult > => {
161155 throw new createError . NotFound ( ) ;
162156 } ) ;
163157
0 commit comments