clear localstorage-mock after each test

This commit is contained in:
Pavel Mineev
2021-02-24 14:56:22 +00:00
parent 4a43092fb5
commit 0a4c8dbe45
3 changed files with 9 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
import 'jest-localstorage-mock';
afterEach(() => {
localStorage.clear();
});
+3
View File
@@ -0,0 +1,3 @@
declare module 'jest-localstorage-mock' {
export const clear: () => void;
}
+1 -1
View File
@@ -17,7 +17,7 @@ module.exports = {
},
setupFiles: ['<rootDir>/jest.setup.ts'],
setupFilesAfterEnv: [
'jest-localstorage-mock',
'<rootDir>/app/__mocks__/localstorage.ts',
'<rootDir>/app/__mocks__/headers.ts',
'<rootDir>/app/__stubs__/remark-config.ts',
'<rootDir>/app/__stubs__/static-config.ts',