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

Support for yield cancel #359

Open
brendt-napp opened this issue Sep 1, 2020 · 0 comments
Open

Support for yield cancel #359

brendt-napp opened this issue Sep 1, 2020 · 0 comments

Comments

@brendt-napp
Copy link

brendt-napp commented Sep 1, 2020

Hello, I'd really like it if we could test something like the following

expectSaga(mySaga)
  .provide([
    [fork(otherSaga), fakeTaskObj]
  ])

  .fork(otherSaga)

  .cancel(fakeTaskObj)

my current workaround is to just use some helper functions and call those

export function cancelSelf() {
  return cancel();
}
export function cancelTasks(tasks = []) {
  return cancel(tasks);
}

and use them like so

expectSaga(mySaga)
  .provide([
    [fork(otherSaga), fakeTaskObj]
  ])

  .fork(otherSaga)
  
  .call(cancelTasks, fakeTaskObj)
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

1 participant