test: clean up restoreAllMocks()

clearAllMocks() does not remove mock implementations, so we need to be
using restoreAllMocks() instead. Also ensure that it is called first
in case the other cleanup code needs to call a mocked function.
This commit is contained in:
David Lechner
2022-04-04 15:51:57 -05:00
parent b9dbaaa5cb
commit 7cb0cf3151
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -16,8 +16,8 @@ import {
} from './actions';
afterEach(async () => {
jest.restoreAllMocks();
cleanup();
jest.clearAllMocks();
localStorage.clear();
});
+1 -1
View File
@@ -8,9 +8,9 @@ import { testRender } from '../../test';
import LicenseDialog from './LicenseDialog';
afterEach(() => {
jest.restoreAllMocks();
cleanup();
localStorage.clear();
jest.clearAllMocks();
});
describe('LicenseDialog', () => {