MENU
Multiple Renderers
( https://reactjs.org/docs/testing-recipes.html#multiple-renderers )
In rare cases, you may be running a test on a component that uses multiple renderers. For example, you may be running snapshot tests on a component with react-test-renderer, that internally uses ReactDOM.render inside a child component to render some content. In this scenario, you can wrap updates with act()s corresponding to their renderers.
RESETRUNFULL
import { act as domAct } from "react-dom/test-utils";import { act as testAct, create } from "react-test-renderer";// ...let root;domAct(() => {
testAct(() => {
root = create(<App />);
});});expect(root).toMatchSnapshot();