license import { Action , composeReducers } from "../index" ; function add ( state , action ) { return state + action . payload ; } function multiply ( state , action ) { return state * action . payload ; } function constant ( payload ) { return { type : "test::constant" , payload } ; } describe ( "composeReducers" , ( ) => { it ( "should no-op when passed no args" , ( ) => { const empty = composeReducers < number > ( ) ; expect ( empty ( 5 , constant ( 4 ) ) ) . toEqual ( 5 ) ; } ) ; it ( "should delegate to the reducer when given one arg" , ( ) => { const reducer = composeReducers ( add ) ; expect ( reducer ( 5 , constant ( 4 ) ) ) . toEqual ( 9 ) ; } ) ; it ( "should apply reducers in-order when given multiple args" , ( ) => { const combined = composeReducers ( add , multiply , add ) ; expect ( combined ( 5 , constant ( 7 ) ) ) . toEqual ( 91 ) ; } ) ; } ) ;