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

Is expectSaga() broken? Odd behavior #385

Closed ehahn9 closed 2 years ago

ehahn9 commented 2 years ago

I'm sure it is a newbie mistake, but I am surprised that the expectSaga() test below times out. -- advice appreciated!

import { expectSaga, testSaga } from 'redux-saga-test-plan';

function* saga() {}

// ...this passes
it('should be testable with testSaga()', () => {
  testSaga(saga).next().isDone();
});

// ...this times out
it('should be testable with expectSaga()', () => {
  return expectSaga(saga).run();
});
nicholaschedid commented 2 years ago

@ehahn9 I'm having the same issue. Did you found a solution?

ehahn9 commented 2 years ago

@nicholaschedid no, never did but we ended up dropping react-saga from the project so I didn't continue to investigate.

MaxToyberman commented 5 months ago

You can use this patch to fix the issue.

redux-saga-test-plan+4.0.6.patch

In general jest 27 had this [BREAKING CHANGE] Remove Node globals setImmediate and clearImmediate (https://github.com/facebook/jest/pull/11222)