Open cdow opened 5 years ago
I've since realized that this effect can be easily tested for in unit tests by making use of the is
method. So, this can be closed if there is no desire to add first class support.
@cdow Could you please provide a sample code?
@AntwanSherif I think he meant something like:
import { testSaga } from 'redux-saga-test-plan';
import { debounce } from 'redux-saga/effects';
import * as sagas from '../sagas';
describe('My component sagas', () => {
it('should do something', () => {
testSaga(sagas.mySaga)
.next()
.is(debounce(200, 'MY-CONSTANT', someFn))
.next()
.isDone();
});
});
However, you could then say that this would work for every baked-in function in the API, as in, you could also write .is(takeLatest)
instead of .takeLatest
and so on. Having said that, I think it would be benefitial for the .debounce
to be part of the API. To keep it consistent with the other calls and avoid using this escape hatch.
@mllustosa Thanks a lot. It works like a charm <3
Please implement support for the
debounce
effect.