GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aheadintranet/react-18-19-suspense-tests: Reproduction repo for @testing-library/react that shows different behaviors when testing Suspense in React 19 vs React 19

BranchesTags
Open more actions menu

Latest commit

 

History

1 Commit
1 Commit

Folders and files

NameName
Last commit message
Last commit date
react-18
react-18
 
 
react-19
react-19
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 

Repository files navigation

@testing-library/react behaves differently when dealing with Suspense in React 18 and React 19

In React 18 it was possible to render a component that suspended and assert against both the Suspense fallback and its children once ready, like this:

render(
  <Suspense fallback="fallback">
    <TestComponent />
  </Suspense>
);

expect(screen.getByText("fallback")).toBeInTheDocument();
expect(await screen.findByText("resolved")).toBeInTheDocument();

In React 19 the same test would be stuck on the fallback. Wrapping the render in an awaited act (as suggested by the warning emitted by RTL) makes assertions against the fallback impossible as act returns after Suspense renders its children.

About

Reproduction repo for @testing-library/react that shows different behaviors when testing Suspense in React 19 vs React 19

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.