Skip to content

Commit

Permalink
✅(frontend) fix mock restore
Browse files Browse the repository at this point in the history
A bug with resetAllMocks has been fixed in jest in
jestjs/jest#13866
It seems like we were relying on it.
  • Loading branch information
kernicPanel committed Feb 20, 2023
1 parent 9cf069f commit de71534
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -21,12 +21,10 @@ describe('sideEffects/uploadFile', () => {
};
const mockXHRClass = jest.fn().mockImplementation(() => mockXHRInstance);

beforeAll(() => {
beforeEach(() => {
(window as any).XMLHttpRequest = mockXHRClass;
});

afterEach(jest.restoreAllMocks);

it('makes an xhr POST to perform the upload, notifies of progress and resolves', async () => {
// Create the promise but don't await it so we can simulate the ongoing request
const response = uploadFile(
Expand Down

0 comments on commit de71534

Please sign in to comment.