It is possible to mock AWS service operation calls with Jest.
Additionally, the AWS SDK can be easily mocked using Jest, replacing or mocking the AWS S3 SDK with an implementation that returns a list of objects or an empty response.
See more results on Neeva
Summaries from the best pages on the web
How to Mock AWS S3 in a Jest (Unit) Test I found it a bit hard to find out how to mock AWS S3 while using Jest. So, I thought I’d document it here.
Mocking is the solution to this problem, by replacing or mocking the AWS S3 SDK we can replace the API calls with our own implementation, for example, returning a list of objects or returning an empty response so that we can test how our code behaves whatever response that API returns.
Easily mock the AWS SDK using jest