mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-22 09:36:43 +03:00
clarify recompute test
This commit is contained in:
parent
7ef89c29e9
commit
d157963ceb
|
@ -153,13 +153,14 @@ describe('devTools', () => {
|
||||||
store.dispatch({ type: 'INCREMENT' });
|
store.dispatch({ type: 'INCREMENT' });
|
||||||
expect(store.getState()).toBe(1);
|
expect(store.getState()).toBe(1);
|
||||||
|
|
||||||
let devStoreState = store.devToolsStore.getState();
|
let stagedActions = [...store.devToolsStore.getState().stagedActions];
|
||||||
devStoreState.committedState = 10;
|
// replace DECREMENT with INCREMENT (stagedAction[0] is @@INIT)
|
||||||
devStoreState.stagedActions[2] = { type: 'INCREMENT' };
|
stagedActions[2] = { type: 'INCREMENT' };
|
||||||
|
const committedState = 10;
|
||||||
|
|
||||||
devToolsStore.dispatch(ActionCreators.recomputeStates(
|
devToolsStore.dispatch(ActionCreators.recomputeStates(
|
||||||
devStoreState.committedState,
|
committedState,
|
||||||
devStoreState.stagedActions
|
stagedActions
|
||||||
));
|
));
|
||||||
|
|
||||||
expect(store.getState()).toBe(13);
|
expect(store.getState()).toBe(13);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user