DEV Community

Discussion on: Why local development for serverless is an anti-pattern

Collapse
 
horaceshmorace profile image
Horace Nelson

No, sam local invoke will test your function in a Docker container running the correct versions of the OS and your language runtime, and while the hardware constraints my not be able to match exactly, it's close enough to be good enough 99% of the time. It's insane to suggest that because the testing environment is not 100% that of production, it is not useful, particularly since I'm talking about one provided by AWS itself. As someone who is constantly building on AWS Serverless technologies, sam local invoke saves a non-insignificant amount of time compared to waiting for sam deploy to finish. I say unit test correctly, and use sam local invoke to test side effects of your functions on other AWS resources in your stack.