Skip to content

How to Catch rejected Promise from Action #39

@dave-irvine

Description

@dave-irvine

If I have an Action that returns a Promise which may either resolve or reject (redux-form requires this for form submission), how can I write a test that handles the error case? Currently if I reject a Promise the tests are crashing out.

With redux-mock-store you could do this:

store.dispatch(actionA()).catch((err) => { expect(err)...... });

But I can't find a way to do this with this library. Any clues?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions