Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Suspense fuzz tests to use act #26498

Merged
merged 1 commit into from
Mar 28, 2023
Merged

Commits on Mar 28, 2023

  1. Update Suspense fuzz tests to use act

    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.
    acdlite committed Mar 28, 2023
    Configuration menu
    Copy the full SHA
    99ea7d9 View commit details
    Browse the repository at this point in the history