You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test('terminates on END action',async()=>{warn.mockClear();function*infiniteLoop(){while(true){// Redux-saga docs:// If you dispatch the END action, then all Sagas blocked on a take Effect// will be terminated regardless of the specified patternyieldtake('HELLO_WORLD');}}awaitexpectSaga(infiniteLoop).dispatch(END).run();expect(warn).not.toHaveBeenCalled();//FAIL!});test('terminates on END action',async()=>{warn.mockClear();function*infiniteLoop(){while(true){yieldtake(END.type);}}awaitexpectSaga(infiniteLoop).dispatch(END).run();expect(warn).not.toHaveBeenCalled();//PASS});
Saga with infinite loop should cancel on END action.
The text was updated successfully, but these errors were encountered: