When mocking Node dependencies, I've happened upon the following libraries:
They all seem to do more-or-less the same thing: allow you to mock require()
calls (with the exception of Sinon which mocks pretty much everything). They all seem to require some pretty elaborate setup, noting the exact syntax of the string passed to require
-- not great during refactoring.
What are the pros and cons of each library? When would I choose one over the other? What are example use-cases where each library excels? What are other products in this space that are better?