Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.
This repository was archived by the owner on Mar 5, 2022. It is now read-only.

[Question] Stubbing/Mocking redux hooks in mountHook #534

@fayeed

Description

@fayeed

I am trying to unit test a custom hook which also uses redux hook, like useSelector & useDispatch but I am getting an error that the hook is not wrapped in Provider. I am mounting the hook using mountHook but am not sure how to get around the provider issue. Any help is appreciated.

Internally the mountHook call the hook inside a component, so I was wondering if there is a way we can change that, or if there is any other work around to go over this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions