When I use Redux-toolkit and redux-persist, I can mock redux-persist just with:
jest.mock('redux-persist', () => {
const real = jest.requireActual('redux-persist');
return {
...real,
persistReducer: jest.fn().mockImplementation((config, reducers) => reducers),
};
});
This works very nicely but when I replace redux-persist with redux-offline I can't get the list of store actions and they are not even fired.
So how I should mock redux-offline and how I can tell it that we should be online for the tests?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…