Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regression test: Bad
shouldYield
causes act
to hang
Based on a bug report from @bvaughn. `act` should not consult `shouldYield` when it's performing work, because in a unit testing environment, I/O (such as `setTimeout`) is likely mocked. So the result of `shouldYield` can't be trusted. In this regression test, I simulate the bug by mocking `shouldYield` to always return `true`. This causes an infinite loop in `act`, because it will keep trying to render and React will keep yielding. I will fix the bug in the next commit by ignoring `shouldYield` whenever we're inside an `act` scope.
- Loading branch information