redux-box
redux-box copied to clipboard
Example with Testing
Thanks for this useful package and all the examples.
I couldn't find any example with a test. Specifically, I am interested in testing sagas. It seems the approach proposed in redux-saga (https://redux-saga.js.org/docs/advanced/Testing.html) is not applicable here or at least is not very straight forward. Appreciate if you provide a test case for sagas.
Thanks
@abtinr you can import the generators from sagas.js file like so:
import { createSagas } from "redux-box"
export const sagas = {
'REQUEST_SOMETHING': function* () { //... }
}
export default createSagas(sagas)
sagas.spec.js
import {sagas} from "./sagas"
// test generator sagas.REQUEST_SOMETHING as per redux-saga docs
Hope it helps!