Skip to content

Commit 500265f

Browse files
committed
new test for replaceReducers
1 parent 8d3ed93 commit 500265f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/replaceReducers.spec.ts

+18
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)