jfairbank / redux-saga-test-plan

Test Redux Saga with an easy plan.
http://redux-saga-test-plan.jeremyfairbank.com
MIT License
1.25k stars 127 forks source link

TypeError: takeLatestEffect is not a function #365

Open HridayK97 opened 4 years ago

HridayK97 commented 4 years ago

My Test:

import { testSaga } from 'redux-saga-test-plan';
import { takeLatest } from 'redux-saga/effects';
import { subscribeSaga } from './sagas'

function* watchSelectSaga() {
  yield takeLatest('SET', subscribeSaga);
}

it('test saga', () => {
  testSaga(watchSelectSaga)
    .next()
    .takeLatestEffect('SET', subscribeSaga)
    .finish()
    .isDone();
});

I get a "TypeError: (0 , _reduxSagaTestPlan.testSaga)(...).next(...).takeLatestEffect is not a function" when running the jest test runner. Is this the correct usage? Any clue why this is happening?

redux-saga: 1.1.1 redux-saga-test-plan: 4.0.0-rc.3

CrushyChilli commented 3 years ago

I encountered the same problem too... Here is what result I get inside next(...)

 console.log
    {
      value: {
        '@@redux-saga/IO': true,
        combinator: false,
        type: 'FORK',
        payload: { context: null, fn: [Function: takeLatest], args: [Array] }
      },
      done: false
    }
AdeonMaster commented 3 years ago

@HridayK97 @CrushyChilli I think you should use takeLatest instead of takeLatestEffect

laffed commented 2 years ago

Breaking changes as of 4.0.0. takeLatestEffect and others have been renamed.

https://github.com/jfairbank/redux-saga-test-plan/blob/master/CHANGELOG.md#testsaga---breaking-changes