0
export function* saga() {
  yield* takeEvery(somethingActions.doSomethingElse, pollSaga);
}

I'm trying to write a test for somethingActions.doSomethingElse, which is fine and all, but I have this line that kicks off pollSaga. I would like to mock the entire call out to pollSaga, i.e. disable it and test it later. Is there a way to do this?

I am just calling dispatch on the somethingActions.doSomethingElse, which works (and the test passes), but pollSaga is being called as a result of the takeEvery and the error output is just annoying. I could use redux-saga-test-plan if that makes it easier.

I have tried

return expectSaga(saga)
      .withState(...)
      .provide([
        [matchers.take(somethingActions.doSomethingElse), undefined],
      ])
      .dispatch(somethingActions.doSomethingElse(...))
      .run();

but this does not seem to work; the pollSaga is still being called.

Thank you!

etnguyen03
  • 580
  • 4
  • 19

0 Answers0