AWS-CDK Utils - Factories
Factories uses fishery to create stock factories for AWS events, helping to accelerate your testing.
Usage
With Jest
import { awsFactory } from '@cdk-utils/factories';
import { handler } from 'src/lambda.ts';
test("lambda", () => {
const event = awsFactory.apiGatewayProxyEventV2({
body: JSON.stringify({ message: 'test'})
})
const result = await handler(event)
expect(result).toEqual({
statusCode: 200,
body: JSON.stringify({
message: 'paased'
})
})
})