Skip to content

Commit f07afbc

Browse files
author
Georg Wicke-Arndt
committed
Simplify test
1 parent 58dab3a commit f07afbc

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
@@ -576,11 +576,6 @@ describe('serializableStateInvariantMiddleware', () => {
576576
})
577577

578578
it('Should cache its results', () => {
579-
const reducer: Reducer<[], AnyAction> = (state = [], action) => {
580-
if (action.type === 'SET_STATE') return action.payload
581-
return state
582-
}
583-
584579
let numPlainChecks = 0
585580
const countPlainChecks = (x: any) => {
586581
numPlainChecks++
@@ -593,8 +588,9 @@ describe('serializableStateInvariantMiddleware', () => {
593588
})
594589

595590
const store = configureStore({
596-
reducer: {
597-
testSlice: reducer,
591+
reducer: (state = [], action) => {
592+
if (action.type === 'SET_STATE') return action.payload
593+
return state
598594
},
599595
middleware: [serializableStateInvariantMiddleware],
600596
})

0 commit comments

Comments
 (0)