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 c916839 commit 9019154
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
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 9019154

Please sign in to comment.