mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
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:
@@ -16,8 +16,8 @@ import {
|
||||
} from './actions';
|
||||
|
||||
afterEach(async () => {
|
||||
jest.restoreAllMocks();
|
||||
cleanup();
|
||||
jest.clearAllMocks();
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import { testRender } from '../../test';
|
||||
import LicenseDialog from './LicenseDialog';
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
cleanup();
|
||||
localStorage.clear();
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
describe('LicenseDialog', () => {
|
||||
|
||||
Reference in New Issue
Block a user