Darko Milosevic
Jan 28, 2020 ⋅ 9 min read

Testing Node serverless applications — AWS Lambda functions

Darko Milosevic I'm a JavaScript developer who loves exploring, coding, and blogging — but only because it's fun.

Recent posts:

Developing Web Extensions With Wxt

Developing web extensions with the WXT library

Browser extensions are an important part of the web ecosystem. They make our lives easier and enhance our web browsing […]

Debjyoti Banerjee
May 24, 2024 ⋅ 8 min read
Bulma Css Adoption Guide: Overview, Examples, And Alternatives

Bulma CSS adoption guide: Overview, examples, and alternatives

Explore how Bulma CSS simplifies frontend development with its ease of use and customizable, responsive, pre-designed UI elements.

Timonwa Akintokun
May 23, 2024 ⋅ 10 min read
Using Mountaineer To Develop A React App With Python

Using Mountaineer to develop a React app with Python

Develop a React app with Python using the Mountaineer framework for building a simple app with integrated your frontend and backend database.

Rosario De Chiara
May 23, 2024 ⋅ 7 min read
Enhance CSS View Transitions With Velevette

Enhance CSS view transitions with Velvette

Velvette is a utility library developed to make working with view transitions easier.

David Omotayo
May 22, 2024 ⋅ 9 min read
View all posts

2 Replies to "Testing Node serverless applications — AWS Lambda functions"

  1. I’m really happy I found your post, as testing in serverless is not a much talked about topic! I’m not sure if you’re following it on purpose, but the pattern you’re proposing is really close to Clean Architecture. One thing that I have done recently to extremely simply writing tests is to abstract out the “interfaces” such as s3, sqs, etc from the business logic. I wrote a wrapper for each interface that presents an api to the business logic, and use an application context factory to inject the interface dependencies. That way, you can test the wrapper, and your business logic – but you can completely fake your interfaces with a test application context. No need to instantiate AWS() in your tests that way.

  2. Thanks Chris!
    Yes, this pattern is quite similar to the Clean Architecture, with the accent on decoupling components (I/O etc) from the core logic.

Leave a Reply