So, you've got some code in React.useEffect and you want to know how to test it. This is a pretty common question. The answer is kinda anti-climatic and general. Here's how you think about testing anything: How does the user make that code run? Make your test do that. That's it. That's the secret. The trick is discovering what constitutes a "user." Your React components actually have 2 users: the
![How to Test React.useEffect](https://cdn-ak-scissors.b.st-hatena.com/image/square/974deb07039b68378c22ba3d302e6172601c6b5c/height=288;version=1;width=512/https%3A%2F%2Fepicreact.dev%2Fhow-to-test-react-use-effect%2Fcard%402x.png)