1 min readMay 17, 2018
This is a very handy trick, thanks Young!
In my project, I created a jest.config.js file that contains the following:
jest.setMock(
‘@mycompany/some-package’, // initial package
require(‘@mycompany/mocks/some-package’) // mocked package
);