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

);

--

--

👨‍💻 Software crafter @SHODO, legacy code / tech debt doctor (http://ajo.ovh/pro) 🥁 Drummer of “Harissa”, VR lover, music digger

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adrien Joly

👨‍💻 Software crafter @SHODO, legacy code / tech debt doctor (http://ajo.ovh/pro) 🥁 Drummer of “Harissa”, VR lover, music digger