Testing AWS Lambda durable functions in TypeScript

AWS Lambda durable functions

Comprehensive testing strategies for AWS Lambda durable functions using local and cloud test runners with TypeScript

This pattern demonstrates comprehensive testing strategies for AWS Lambda durable functions using the Durable Execution SDK testing library.
It includes five key testing scenarios: basic workflows with wait operations, retry logic validation, callback testing for external events, parallel operations testing, and nested function composition.
The pattern uses LocalDurableTestRunner for fast local testing with time-skipping and CloudDurableTestRunner for integration testing against deployed functions.
All tests demonstrate best practices including operation inspection, mock external dependencies, callback simulation, and function registration for nested workflows.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-durable-testing-typescript-sam

Deploy

sam buildsam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Created by:

Abhishek Agawane

Abhishek Agawane

I am a Cloud Support Engineer (Serverless) at AWS who loves cloud computing

Eric Johnson

Eric Johnson

Eric Johnson is a Principal Developer Advocate for Serverless Applications at Amazon Web Services and is based in Northern Colorado. Eric is a fanatic about serverless and enjoys helping developers understand how serverless technologies introduces a major paradigm shift in how they approach building and running applications at massive scale with minimal administration overhead. Prior to this, Eric has worked as a developer, solutions architect and AWS Evangelist for an AWS partner company.

Follow on LinkedIn