Last active
February 20, 2023 17:15
-
-
Save marta-pinkowska/2d301a9b2ba72fb3358c57e14fadc4f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// counter.perf-test.tsx | |
test('Count increments on press', async () => { | |
const scenario = async (screen: RenderAPI) => { | |
const button = screen.getByText('Action'); | |
await screen.findByText('Count: 0’); | |
fireEvent.press(button); | |
fireEvent.press(button); | |
await screen.findByText('Count: 2'); | |
}; | |
const stats = await measurePerformance( | |
<Counter />, | |
{ scenario, runs: 20 } | |
); | |
await writeTestStats(stats); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment