()
| 181 | |
| 182 | it('should flush effects if there are pending effects before `act` call', () => { |
| 183 | function Counter() { |
| 184 | const [count, setCount] = useState(0); |
| 185 | useEffect(() => { |
| 186 | setCount(count => count + 1); |
| 187 | }, []); |
| 188 | return <div>{count}</div>; |
| 189 | } |
| 190 | |
| 191 | // Render a component which schedules an effect outside of an `act` |
| 192 | // call. This will be scheduled to execute after the next paint as usual. |