javascript - How to test saga -
can me writing unit test cases sagas.
import {take, call, takeevery} "redux-saga/effects"; import * actions "../../actions/index"; import * workers "../workers/favorite-worker"; export function* watchgetfavorites() { const loadaction = yield take(actions.get_favorites); yield call(workers.fetchfavorites, loadaction.payload); } export function* watchdeletefavorites() { yield takeevery(actions.delete_favorite, function*(loadaction) { yield call(workers.deletefavorites, loadaction.payload); }); }
any highly appreciated.
Comments
Post a Comment