I'm trying to mock a destructed import with Jest.
In the component is the destructed import:
import { getSomething } from 'utils/paymentUtils';
In the test:
import React from 'react';
import { shallow } from 'enzyme';
import Component from 'components/Component';
import * as utils from 'utils/paymentUtils';
jest.mock('utils');
describe('Something', () => {
let wrapper;
utils.getSomething.mockImplementation(() => 'Blah');
The error I'm getting is:
Cannot find module 'utils' from 'Component.spec.js'
jest.mock('utils/paymentUtils')- skyboyer