dillon1000/react
Commit
Browse files Update Suspense fuzz tests to use `act` (#26498)
This updates the Suspense fuzz tester to use `act` to recursively flush timers instead of doing it manually. This still isn't great because ideally the fuzz tester wouldn't fake timers at all. It should resolve promises using a custom queue instead of Jest's fake timer queue, like we've started doing in our other Suspense tests (i.e. the `resolveText` pattern). That's because our internal `act` API (not the public one, the one we use in our tests) uses Jest's fake timer queue as a way to force Suspense fallbacks to appear. However I'm not interested in upgrading this test suite to a better strategy right now because if I were writing a Suspense fuzzer today I would probably use an entirely different approach. So this is just an incremental improvement to make it slightly less decoupled to React implementation details.
Changed paths2 files
First-parent comparisonpackages/internal-test-utils/internalAct.js ModifiedM packages/react-reconciler/src/__tests__/ReactSuspenseFuzz-test.internal.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…