jest-webpack-resolver icon indicating copy to clipboard operation
jest-webpack-resolver copied to clipboard

Jest module mocks do not work with this resolver

Open mlippens opened this issue 7 years ago • 2 comments

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() {} })).

mlippens avatar Feb 05 '18 14:02 mlippens

I'm running into this as well, no leads just yet but I'd love to help come up with a fix.

foleyatwork avatar Sep 05 '18 22:09 foleyatwork

has to do with https://github.com/jamietre/jest-custom-resolver-problem

vzaidman avatar Aug 18 '19 14:08 vzaidman