I was wondering this too a few years back when serverless started to gain traction. I remember thinking it sounded like a lot of mock infrastructure. Just did a search and found the following links interesting:
https://medium.freecodecamp.org/the-best-ways-to-test-your-s... https://github.com/lambci/docker-lambda
It seems non-trivial to set up at this point
EDIT: Still reading into it... https://serverless.com/framework/docs/providers/aws/guide/te...
Would love to here a best practice case study from someone who has deployed something like this