4 ms·
Agree, not intentionally misleading though. Just a lack of a better word I guess. Original title was "Building a serverless emailing service". About testing: I
by joawan 5y ago
Agree, not intentionally misleading though. Just a lack of a better word I guess. Original title was "Building a serverless emailing service".
About testing: It's not that different from any other runtime. I admit, I put a lot of code into the same file in the examples as it was easier displaying the code that way. I tend to keep the handler of the lambda very lightweight and then test the functions that the handler calls. That way it's just unit testing and mocking away dependencies. The functions are pretty small so naive dependency injection works fine.
AWS docs covers testing of Lambdas a bit here: https://docs.aws.amazon.com/whitepapers/latest/serverless-architectures-lambda/unit-tests.html https://docs.aws.amazon.com/whitepapers/latest/serverless-ar...