Open timB73 opened 4 years ago
I seem to get the same error with version 1.1.1 of redux-saga and 4.0.0-rc.2 of redux-saga-test-plan
@timB73 do you have sample to reproduce this?
Actually it looks like it might not be to do with redux-saga-test-plan as I got the same error trying to create my own helper function based on redux-saga docs... very confused 🤔
import { runSaga } from 'redux-saga';
export async function recordSaga(saga, initialAction, initialState) {
const dispatched = [];
await runSaga(
{
dispatch: action => dispatched.push(action),
getState: () => initialState
},
saga,
initialAction
).toPromise();
return dispatched;
}
It gives error cannot read 'toPromise' of undefined when I call runSaga with a basic generator function. I can't find anything about this anywhere so must be something to do with my setup ??
I am experiencing the same problem here with code very similar to yours @timB73 . Did you find a solution?
I am experiencing the same problem here with code very similar to yours @timB73 . Did you find a solution?
Unfortunately I didn't :(
I am using redux-saga version 1.1.3 and version 4.0.0-rc.3 of redux-saga-test-plan. Are these not compatible with each other? I ran the example test and I get the following error: "TypeError: Cannot read property 'toPromise' of undefined" which happens at the run() method.
at taskPromise (node_modules/redux-saga-test-plan/lib/expectSaga/index.js:590:17)
at start (node_modules/redux-saga-test-plan/lib/expectSaga/index.js:601:23) at Object.run (node_modules/redux-saga-test-plan/lib/expectSaga/index.js:646:5)