- Create a file like
__mocks__/lodash/memoize.js:module.exports = a => a - Add to your test:jest.mock(‘lodash/memoize’)
Note: When using
babel-jest, calls tojest.mockwill automatically be hoisted to the top of the code block. Usejest.doMockif you want to explicitly avoid this behavior.