diff --git a/test/index.js b/test/index.js index 2644744..2e3ea19 100644 --- a/test/index.js +++ b/test/index.js @@ -264,6 +264,17 @@ basic('commit other transaction', { } }); +test('omits optimist from original reducer', () => { + function originalReducer(state = {value: 0}, action) { + assert(state.value === 0); + assert(!state.hasOwnProperty('optimist')); + return state; + } + let reducer = optimist(originalReducer); + let state; + state = reducer(state, {type: 'foo'}); + state = reducer(state, {type: 'foo'}); +}); test('real world example', () => { function originalReducer(state = {value: 0}, action) {