DEV Community

Discussion on: An Introduction to testing in Javascript

Collapse
 
chiubaca profile image
Alex Chiu

mocking confuses the bejesus out of me

Collapse
 
gabrieltanner profile image
Gabriel Tanner

Do you mean mocking in general or my explanation in the article? It would be valuable for me if you could provide more information so I can improve the article for future readers.

I'm also available if you have any questions regarding mocking or testing in general if that would help you.

Collapse
 
chiubaca profile image
Alex Chiu

Yes mocking in general. I've watched a dozen tutorials and read many articles like this, but I just cant seem grok it in practice. Especially when there are third party libs involved I find mocking conceptually really confusing. It's hard for me to articulate to be honest.

The specific issue I have at the moment is around AWS lambda functions. My business logic resides all in callback function which has events I can tap into. I'm currently so lost trying to figure out how A) I mock the callback function B) how I mock the all properties in the event object... 😵