mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 08:30:02 +03:00
Fix
This commit is contained in:
parent
96c2fd9988
commit
f8685c57e0
|
@ -3,6 +3,9 @@ import { compose, createStore } from 'redux';
|
||||||
|
|
||||||
describe('persistState', () => {
|
describe('persistState', () => {
|
||||||
const savedLocalStorage = global.localStorage;
|
const savedLocalStorage = global.localStorage;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
delete global.localStorage;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
global.localStorage = {
|
global.localStorage = {
|
||||||
|
@ -118,9 +121,9 @@ describe('persistState', () => {
|
||||||
const spy = jest.spyOn(console, 'warn').mockImplementation(() => {
|
const spy = jest.spyOn(console, 'warn').mockImplementation(() => {
|
||||||
// noop
|
// noop
|
||||||
});
|
});
|
||||||
global.localStorage.getItem = () => {
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
throw new Error();
|
// @ts-ignore
|
||||||
};
|
delete global.localStorage.getItem;
|
||||||
createStore(reducer, compose(instrument(), persistState('id')));
|
createStore(reducer, compose(instrument(), persistState('id')));
|
||||||
|
|
||||||
expect(spy.mock.calls[0]).toContain(
|
expect(spy.mock.calls[0]).toContain(
|
||||||
|
@ -134,9 +137,9 @@ describe('persistState', () => {
|
||||||
const spy = jest.spyOn(console, 'warn').mockImplementation(() => {
|
const spy = jest.spyOn(console, 'warn').mockImplementation(() => {
|
||||||
// noop
|
// noop
|
||||||
});
|
});
|
||||||
global.localStorage.setItem = () => {
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
throw new Error();
|
// @ts-ignore
|
||||||
};
|
delete global.localStorage.setItem;
|
||||||
const store = createStore(
|
const store = createStore(
|
||||||
reducer,
|
reducer,
|
||||||
compose(instrument(), persistState('id'))
|
compose(instrument(), persistState('id'))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user