Open rkaartikeyan opened 2 years ago
Hi everyone,
thanks for this great library. In my project I am getting bellow error on await expectSaga
await expectSaga
Refactor this redundant 'await' on a non-promise.sonarlint(typescript:S4123)
saga.test.ts
it('validate watchFetch', async () => { store.dispatch(watchFetch({id: 1001})); const effects = await expectSaga(watchFetch) .put(setInfo({id: 1000, name: 'test'})) .dispatch({type: 'user/fetch'}); effects.silentRun(); });
sage.ts
// fetch worker function* fetch(action){ const {data} = yield(call(Api, {url: '...', params: {id: action.payload.id}})); put(setInfo(data)); } // fetch watcher function* watchFetch() { yield takeLatest( 'user/fetch', fetch, ); }
if I remove the async and await then put() is not covered in fetch()...
put()
fetch()...
Please let me know what did I missed here?
Hi everyone,
thanks for this great library. In my project I am getting bellow error on
await expectSaga
Refactor this redundant 'await' on a non-promise.sonarlint(typescript:S4123)
saga.test.ts
sage.ts
if I remove the async and await then
put()
is not covered infetch()...
Please let me know what did I missed here?