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

Love podcasts or audiobooks? Learn on the go with our new app.

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

Adrien Joly

1.8K Followers

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