Fix warning of App.test.js test by wrapping rendering in "act"
import React from "react";
import ReactDOM from "react-dom";
+import { act } from "react-dom/test-utils";
import App from "./App";
it("renders without crashing", async () => {
const div = document.createElement("div");
let statsResolver;
const StatsReadyPromise = new Promise((resolve) => (statsResolver = resolve));
+ await act(async () => {
ReactDOM.render(<App onStatsReady={statsResolver} />, div);
await StatsReadyPromise;
+ });
ReactDOM.unmountComponentAtNode(div);
});
