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

feat(renderHook): allow passing of all render options to renderHook #1118

Merged
merged 2 commits into from Sep 4, 2022

Conversation

TkDodo
Copy link
Contributor

@TkDodo TkDodo commented Sep 4, 2022

What:
allow passing of all render options to renderHook
this allows using options like legacyRoot as well

Why: As discussed here:

How:

renderHook uses render under the hood, but not all RenderOptions were allowed to pass - only wrapper was forwarded. This PR passes all other options to render as well.

My intention was to allow legacyRoot, so if you want me to limit it to this option, I can also do that. I'm not sure if all options are worth forwarding or if there are some that don't make sense.

docs site would still need to be updated - is this a separate repo / PR ?

Checklist:

  • Documentation added to the
    docs site
  • Tests
  • TypeScript definitions updated
  • Ready to be merged

this allows using options like `legacyRoot` as well
@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 4, 2022

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 10dfd0e:

Sandbox Source
React Configuration
react-testing-library-examples Configuration

@codecov
Copy link

codecov bot commented Sep 4, 2022

Codecov Report

Merging #1118 (10dfd0e) into main (73ee9ba) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main     #1118   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          181       181           
  Branches        36        36           
=========================================
  Hits           181       181           
Flag Coverage Δ
experimental 100.00% <100.00%> (ø)
latest 100.00% <100.00%> (ø)
next 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pure.js 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Yep works. Thanks for the test!

@eps1lon eps1lon merged commit 27a9584 into testing-library:main Sep 4, 2022
@eps1lon
Copy link
Member

eps1lon commented Sep 4, 2022

@all-contributors add @TkDodo for code

@allcontributors
Copy link
Contributor

@eps1lon

I've put up a pull request to add @TkDodo! 🎉

@github-actions
Copy link

github-actions bot commented Sep 4, 2022

🎉 This PR is included in version 13.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@TkDodo TkDodo deleted the feature/legacyroot-renderhook branch September 4, 2022 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants