More fixes

This commit is contained in:
Nathan Bierema 2021-06-16 11:25:45 -04:00
parent 6790090b90
commit 96c2fd9988
2 changed files with 10 additions and 3 deletions

View File

@ -1141,6 +1141,8 @@ describe('instrument', () => {
const importMonitoredLiftedStore = importMonitoredStore.liftedStore;
const noComputedExportedState = Object.assign({}, exportedState);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
delete noComputedExportedState.computedStates;
importMonitoredLiftedStore.dispatch(
@ -1184,6 +1186,8 @@ describe('instrument', () => {
state: LiftedState<S, A, null>
) {
state.actionsById = _.mapValues(state.actionsById, (action) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
delete action.timestamp;
delete action.stack;
return action;

View File

@ -3,7 +3,6 @@ import { compose, createStore } from 'redux';
describe('persistState', () => {
const savedLocalStorage = global.localStorage;
delete global.localStorage;
beforeEach(() => {
global.localStorage = {
@ -119,7 +118,9 @@ describe('persistState', () => {
const spy = jest.spyOn(console, 'warn').mockImplementation(() => {
// noop
});
delete global.localStorage.getItem;
global.localStorage.getItem = () => {
throw new Error();
};
createStore(reducer, compose(instrument(), persistState('id')));
expect(spy.mock.calls[0]).toContain(
@ -133,7 +134,9 @@ describe('persistState', () => {
const spy = jest.spyOn(console, 'warn').mockImplementation(() => {
// noop
});
delete global.localStorage.setItem;
global.localStorage.setItem = () => {
throw new Error();
};
const store = createStore(
reducer,
compose(instrument(), persistState('id'))