require-me
Require uncached module with mocks
Note: This module works in browsers and Node.js >= 4.0
Installation
npm install require-me
Usage
const requireMe = ; const otherDep1Mock = ; const otherModule =
API
modulePath (String) - Module name or path
options (Object)
mocks
(Object) - Map of mocks of module dependencies as{'module_dependency_path': 'mock_path'}
.module_dependency_path
andmock_path
resolves relatively current file. You can use object or function instead ofmock_path
. It use mock-require for mockingpristine
(Boolean) - Clean npm cache before loadingdeep
(Boolean) - Clean npm cache for submodules except external and system modules
Return value (Any): Module.exports
Tests
npm installnpm test