jest-webpack-resolver
jest-webpack-resolver copied to clipboard
Jest module mocks do not work with this resolver
I've got an example project here to provide some context. It provides one test that fails with the webpack resolver and succeeds when turning the resolver off. The repository can be found here: https://github.com/mlippens/jest-webpack-resolver-mock-issue.
The issue seems to be the combination of the webpack resolver with jest.mock('../../someModule'), when using the variant of mock using a factory then all is well jest.mock('../../someModule', () => ({ getLogLevel() {} })).
I'm running into this as well, no leads just yet but I'd love to help come up with a fix.
has to do with https://github.com/jamietre/jest-custom-resolver-problem