mock-require
mock-require copied to clipboard
Fix: reRequiring files with naming collisions with mock-require
This change fixes #36 by making require.resolve
explicit in where it is resolving from. It therefore prevents collisions with files in mock-require
, which are themselves in the NODE_PATH
, triggering the isInPath
condition to return the mock-require
file.
To illustrate the change I moved the module itself to the NODE_PATH
for the test.