File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "dependencies" : {
3+ "@types/aws-lambda" : " ^8.10.148" ,
34 "esbuild" : " ^0.24.0"
45 },
56 "devDependencies" : {
67 "@tsconfig/node22" : " ^22.0.2" ,
7- "@types/aws-lambda" : " ^8.10.148" ,
88 "@types/jest" : " ^30.0.0" ,
99 "jest" : " ^30.2.0" ,
1010 "jest-mock-extended" : " ^4.0.0" ,
Original file line number Diff line number Diff line change 1- import type { Context } from "aws-lambda" ;
1+ import type { Context , SQSEvent } from "aws-lambda" ;
22import { mockDeep } from "jest-mock-extended" ;
33import handler from ".." ;
44
55describe ( "event-logging Lambda" , ( ) => {
6- it ( "logs the input event and returns 200 " , async ( ) => {
7- const event = { foo : "bar " } ;
6+ it ( "completes successfully " , async ( ) => {
7+ const event = { Records : [ { body : "{} " } ] } as SQSEvent ;
88 const context = mockDeep < Context > ( ) ;
99 const callback = jest . fn ( ) ;
10- const result = await handler ( event , context , callback ) ;
11-
12- expect ( result ) . toEqual ( {
13- statusCode : 200 ,
14- body : "Event logged" ,
15- } ) ;
10+ await handler ( event , context , callback ) ;
1611 } ) ;
1712} ) ;
You can’t perform that action at this time.
0 commit comments