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.
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);
therequire.resolve('koa-bodyparser')
still returns the actual path, whererequire('koa-bodyparser')
returnsnull
.To allow the best of both ways, this could be an config option to mockery.
Thanks!