dillon1000/react

Commit

Add a test-only transform to catch infinite loops (#11790)

* Add a test-only transform to catch infinite loops

* Only track iteration count, not time

This makes the detection dramatically faster, and is okay in our case because we don't have tests that iterate so much.

* Use clearer naming

* Set different limits for tests

* Fail tests with infinite loops even if the error was caught

* Add a test
Browse files
Changed paths4 files
First-parent comparison
A scripts/babel/__tests__/transform-prevent-infinite-loops-test.js AddedA scripts/babel/transform-prevent-infinite-loops.js AddedM scripts/jest/preprocessor.js ModifiedM scripts/jest/setupTests.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…