は、私がこのユニットテストレデューサー、各スライスレデューサーまたは組み合わせレデューサーをテストしますか?
export default combineReducers({
A: combineReducers({ A1, A2 }),
B: reducerB,
C: reducerC
})
などの減速ファイルリデューサー/ group1.jsは、各スライスの減速(A1、A2、reducerBとreducerC)をテストし、合わせたものをテストする間に違いはありますがあると?
import group1 from 'reducers/group1'
describe('reducers',() => {
describe('group1',() => {
it('should provide the initial state',() => {
expect(group1(undefined, {})).to.equal({ group1: { A: { ... }, B: ... } })
})
it(...)
// ...
})
})
または
import { A1, A2, reducerB, reducerC } from 'reducers/group1'
describe('reducers',() => {
describe('group1',() => {
describe('A1',() => {
it('should provide the initial state',() => {
expect(A1(undefined, {})).to.equal(0) // if A1 is just a number
})
})
describe('A2',() => { ... })
describe('reducerB',() => { ... })
describe('reducerC',() => { ... })
})
})