How to mock interceptors when using jest.mock('axios')?
问题 When running a test using jest I have the basic test suit syntax: jest.mock('axios'); describe('app', () => { let render beforeEach(() => { axiosMock.get.mockResolvedValueOnce({ data: {greeting: 'hello there'}, }), render= renderApp() }); test('should render something', () => { expect(something).toBeInTheDocument(); }); }); The problem is I have interceptors in my code which when running the test with jest command outputs: TypeError: Cannot read property 'interceptors' of undefined and points