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

Add async render APIs #1365

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 25, 2024

Not final. For internal testing for now. Alternate to #1214

  • render(...) -> await renderAsync(...)
  • act(...) -> await actAsync(...)
  • cleanup(...) -> await cleanupAsync(...)
  • renderHook(...) -> await renderHookAsync(...)

Copy link

codesandbox-ci bot commented Nov 25, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9d9778c:

Sandbox Source
react-testing-library-examples Configuration

Comment on lines +19 to +21
return await React.act(async () => {
scope()
})
Copy link
Member

Choose a reason for hiding this comment

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

pretty sure this should be

Suggested change
return await React.act(async () => {
scope()
})
return await React.act(async () => {
await scope()
})

or

Suggested change
return await React.act(async () => {
scope()
})
return await React.act(async () => {
return scope()
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants