Skip to content

Commit bcd0615

Browse files
Georg Wicke-Arndtmarkerikson
Georg Wicke-Arndt
authored andcommitted
Simplify test
1 parent f9049cc commit bcd0615

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/toolkit/src/tests/serializableStateInvariantMiddleware.test.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,6 @@ describe('serializableStateInvariantMiddleware', () => {
598598
})
599599

600600
it('Should cache its results', () => {
601-
const reducer: Reducer<[], AnyAction> = (state = [], action) => {
602-
if (action.type === 'SET_STATE') return action.payload
603-
return state
604-
}
605-
606601
let numPlainChecks = 0
607602
const countPlainChecks = (x: any) => {
608603
numPlainChecks++
@@ -615,8 +610,9 @@ describe('serializableStateInvariantMiddleware', () => {
615610
})
616611

617612
const store = configureStore({
618-
reducer: {
619-
testSlice: reducer,
613+
reducer: (state = [], action) => {
614+
if (action.type === 'SET_STATE') return action.payload
615+
return state
620616
},
621617
middleware: [serializableStateInvariantMiddleware],
622618
})

0 commit comments

Comments
 (0)