Hi everyone,
Are there best practices when using Sinon to test AWS Lambda? While I understand the practice of stubbing, mocking, and spying, I have not found a best approach with Lambda as everything is a private reference inside the module (aka no injecting dependencies). There are a couple options, listed below, I found that attempt to address the issue by handling proxying or mocking at the require level. It does not feel quite right, a little smelly, as I read through the details.
Proxyquire
Mock Require
Given my lack of familiarity with Sinon, I would love any input, direction, or examples!
Cheers,
Chad