clear localstorage-mock after each test
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import 'jest-localstorage-mock';
|
||||
|
||||
afterEach(() => {
|
||||
localStorage.clear();
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
declare module 'jest-localstorage-mock' {
|
||||
export const clear: () => void;
|
||||
}
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user