Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: takeLatestEffect is not a function #365

Open
HridayK97 opened this issue Oct 26, 2020 · 3 comments
Open

TypeError: takeLatestEffect is not a function #365

HridayK97 opened this issue Oct 26, 2020 · 3 comments

Comments

@HridayK97
Copy link

HridayK97 commented Oct 26, 2020

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
Copy link

CrushyChilli commented Dec 24, 2020

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
Copy link
Contributor

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

@laffed
Copy link

laffed commented Feb 12, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants