Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pytqqq/55ef3439f90ed70cd9a233fc276a56d1 to your computer and use it in GitHub Desktop.
Save pytqqq/55ef3439f90ed70cd9a233fc276a56d1 to your computer and use it in GitHub Desktop.
import React from "react";
import { screen, fireEvent } from "@testing-library/react-native";
import { measurePerformance } from "reassure";
import { AsyncComponent } from "../AsyncComponent";
test("AsyncComponent", async () => {
const scenario = async () => {
const button = screen.getByText("Action");
fireEvent.press(button);
await screen.findByText("Count: 1");
fireEvent.press(button);
await screen.findByText("Count: 2");
fireEvent.press(button);
fireEvent.press(button);
fireEvent.press(button);
await screen.findByText("Count: 5");
};
await measurePerformance(<AsyncComponent />, { scenario });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment