Adrien Joly
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

);

--

--

Adrien Joly

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