Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Support require.resolve to not return the path. #42

Open
nicolasgramlich opened this issue Feb 17, 2016 · 2 comments
Open

Support require.resolve to not return the path. #42

nicolasgramlich opened this issue Feb 17, 2016 · 2 comments

Comments

@nicolasgramlich
Copy link

Ideally, we would be able to also have require.resolve return something different than the actual implementation.

I.e. I'm trying to check for the absence of a module. And in my code, after mocking via mockery.registerMock('koa-bodyparser', null);
the require.resolve('koa-bodyparser') still returns the actual path, where require('koa-bodyparser') returns null.

To allow the best of both ways, this could be an config option to mockery.

Thanks!

@klausbayrhammer
Copy link

+1

@ah584d
Copy link

ah584d commented Jul 3, 2018

does it has been implemented? i really need it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants