const { success, data, error } = yield call(api.get, 'url', params) if (success) { yield put('FETCH_TODOS_SUCCESS', data); // simplified } else { yield put('FETCH_TODOS_ERROR', params) // simplified } } it('handles success correctly', () => { const gen = fetchTodos(); expect(gen.next().value).to.eql(put(...)) expect(gen.next().value).to eql(call(api.get, ...)) expect(gen.next({ success: true, data: 10 })).to.eql(put(...)) // successAction expect(gen.next().value).to.eql(undefined) // all done })