Skip to content

Commit

Permalink
test(core): cover S3 middyfied handler
Browse files Browse the repository at this point in the history
  • Loading branch information
naorpeled committed Jun 6, 2024
1 parent 593d40b commit caa712c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/core/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import {
APIGatewayProxyEvent,
APIGatewayProxyResult,
Context,
Handler as AWSLambdaHandler
Handler as AWSLambdaHandler,
S3Handler,
S3Event
} from 'aws-lambda'

// extends Handler type from aws-lambda
Expand Down Expand Up @@ -400,3 +402,14 @@ const baseHandler: AWSLambdaHandler = async (event) => {

const handler1176 = middy(baseHandler)
expectType<MiddyfiedHandler<any, any, Error, Context, {}>>(handler1176)


// Issue #1182
const s3Handler: S3Handler = async (event) => {
await Promise.all(event.Records.map(() => Promise.resolve()));
};

const handler1182 = middy(s3Handler)
expectType<MiddyfiedHandler<S3Event, void, Error, Context, {}>>(handler1182)


0 comments on commit caa712c

Please sign in to comment.