Skip to content

Can't fix "not wrapped in act(...)" warning with Jest and React Testing Library #641

@FlorianBurgevin

Description

@FlorianBurgevin

Hello,

I'm trying to test my React Application with React Testing Library and Jest but I always have the following error.

An update to StoreProvider inside a test was not wrapped in act(...)

I tried many things like put act() function around my test but can't be able to remove the warning and get the correct result.

Here's a simplified project that demonstate the problem:
https://codesandbox.io/s/adoring-haslett-6rq34?file=/src/PageContent.test.js

Thanks for your help.

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