mock-require icon indicating copy to clipboard operation
mock-require copied to clipboard

Fix: reRequiring files with naming collisions with mock-require

Open treygriffith opened this issue 6 years ago • 0 comments

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.

treygriffith avatar Nov 26 '18 18:11 treygriffith