One of the issues people ran into with earlier versions of mockery has been updating the Node module cache. In particular, caching of mocks beyond their intended usage, and caching of previously 'require'd modules causing problems with mocks being picked up. The recently-released mockery 1.4.0 has a new option specifically to allow some control over this. It's called the "clean cache" option, and allows you to run your tests as if Node had an empty module cache. See:
https://github.com/mfncooper/mockery#controlling-the-module-cache For mockery in general: npm install mockery https://npmjs.org/package/mockery https://github.com/mfncooper/mockery Note: Please don't confuse 'mockery' with 'Mockery', which someone else created a few months after 'mockery' was released and then deprecated but which is still in the registry. -- Martin Cooper -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
