vendredi 17 avril 2020

An update to Provider inside a test was not wrapped in act(...) with Jest + React Testing Library

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.

Aucun commentaire:

Enregistrer un commentaire