I am trying to write a unit test for a simple saga code snippet. Whenever I run any test I just get a message saying 'cannot read property 'param' of undefined.
const { param } = yield take(action.FETCH_ACTION)
I expect this is because the param is not getting assigned through whatever test I write.
An example of how I am trying to test this is:
expect(generator.next().value).toEqual(take(actions.FETCH_ACTION))
This was working fine for me before I added this parameter in my action creator. But now that I am trying to use this parameter I need to include it in the rest of my tests.
How can I write a unit test that can correctly assign this param value and use it in upcoming tests?