Skip to content

Strengthen nested update counter test coverage#15166

Merged
gaearon merged 4 commits into
react:masterfrom
gaearon:inflooptests
Mar 21, 2019
Merged

Strengthen nested update counter test coverage#15166
gaearon merged 4 commits into
react:masterfrom
gaearon:inflooptests

Conversation

@gaearon

@gaearon gaearon commented Mar 20, 2019

Copy link
Copy Markdown
Collaborator

This adds isolation between tests because they used to interfere (e.g. with a change to the logic, a test could fail with other tests but pass when focused).

After adding isolation, I found a few situations that aren't really covered by existing cases alone, but that are important to test. So I'm adding explicit cases for those.

gaearon added 2 commits March 20, 2019 16:09
This ensures their behavior is consistent when run in isolation, and that they actually test the cases they're describing.
These cases explicitly verify that we reset the counter in right places.
@gaearon
gaearon requested a review from trueadm March 21, 2019 14:48

@trueadm trueadm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. :)

@gaearon
gaearon merged commit 3151813 into react:master Mar 21, 2019
@gaearon
gaearon deleted the inflooptests branch March 21, 2019 14:55
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
* Isolate ReactUpdates-test cases

This ensures their behavior is consistent when run in isolation, and that they actually test the cases they're describing.

* Add coverage for cases where we reset nestedUpdateCounter

These cases explicitly verify that we reset the counter in right places.

* Add a mutually recursive test case

* Add test coverage for useLayoutEffect loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants