Im trying to unmock axios module inside the test function, but it keeps returning the mocked response even tho i have declared the dontMock function. What am i doing wrong?
import Axios from 'axios';
jest.mock('axios');
describe('Testing Async Selectors', () =>
it('should render empty dropdown', async () => {
console.log(Axios);
});
it('should render empty dropdown', async () => {
jest.dontMock('axios');
console.log(Axios);
});
});
jest.dontMock(moduleName) should be used with jest.doMock(moduleName, factory, options).
E.g.
unit test result: