Easily mock out required modules using Unexpected and mock-require.

NOTE: This only works with modules that are required at run time!

NPM version Build Status Coverage Status Dependency Status

expect(function () {
    require('./some-module');
}, 'with require mocked out', {
    './some-module': {}
}, 'not to throw');
Fork me on GitHub