Skip to content

Commit 32ee54c

Browse files
committed
✅(frontend) fix mock restore
A bug with resetAllMocks has been fixed in jest in jestjs/jest#13866 It seems like we were relying on it.
1 parent b820dd5 commit 32ee54c

File tree

1 file changed

+1
-3
lines changed
  • src/frontend/packages/lib_components/src/data/sideEffects/uploadFile

1 file changed

+1
-3
lines changed

src/frontend/packages/lib_components/src/data/sideEffects/uploadFile/index.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ describe('sideEffects/uploadFile', () => {
2121
};
2222
const mockXHRClass = jest.fn().mockImplementation(() => mockXHRInstance);
2323

24-
beforeAll(() => {
24+
beforeEach(() => {
2525
(window as any).XMLHttpRequest = mockXHRClass;
2626
});
2727

28-
afterEach(jest.restoreAllMocks);
29-
3028
it('makes an xhr POST to perform the upload, notifies of progress and resolves', async () => {
3129
// Create the promise but don't await it so we can simulate the ongoing request
3230
const response = uploadFile(

0 commit comments

Comments
 (0)