jest.resetModules() clears the require cache for all modules but is there a way to clear it for just a single module? Can't use require.cache as Jest appears to bypass it.
I'm testing a Node module which is stateful (i.e. it relies on the fact that multiple calls to require return the same instance). For my test I need to reset the state of the module to test different scenarios. jest.resetModules() works but then I need to re-require some other mocked modules which didn't need to be reset.