You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code I was testing relies on Node's built in require.resolve() function, running it before the module is imported. Unfortunately, since this library replaces require() and calls the module immediately before replacing custom mocks, I was unable to stub require.resolve() using loadFile()'s mocks or globals arguments.
For anyone also having this problem, I'm using proxyquire (which is similar to mocks.loadFile()) as a workaround.
The text was updated successfully, but these errors were encountered:
The code I was testing relies on Node's built in
require.resolve()
function, running it before the module is imported. Unfortunately, since this library replacesrequire()
and calls the module immediately before replacing custom mocks, I was unable to stubrequire.resolve()
usingloadFile()
'smocks
orglobals
arguments.For anyone also having this problem, I'm using proxyquire (which is similar to
mocks.loadFile()
) as a workaround.The text was updated successfully, but these errors were encountered: