We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d3ed93 commit 500265fCopy full SHA for 500265f
test/replaceReducers.spec.ts
@@ -0,0 +1,18 @@
1
+import { createStore, combineReducers } from '..'
2
+
3
+describe('replaceReducers test', () => {
4
+ it('returns the original store', () => {
5
+ const nextReducer = combineReducers({
6
+ foo: (state = 1, _action) => state,
7
+ bar: (state = 2, _action) => state
8
+ })
9
+ const store = createStore((state, action) => {
10
+ if (state === undefined) return 5
11
+ return action
12
13
14
+ const nextStore = store.replaceReducer(nextReducer)
15
16
+ expect(nextStore).toBe(store)
17
18
+})
0 commit comments