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: add reactStrictMode option to enable strict mode render #1241

Merged
merged 8 commits into from Jan 30, 2024

Conversation

yinm
Copy link
Contributor

@yinm yinm commented Oct 8, 2023

What:

Add reactStrictMode option to enable strict mode render

Why:

ref: #338

How:

This PR updates getConfig and configure functions from DTL for handling RTL options (e.g. reactStrictMode).
This PR also wraps UI in render function with React.StrictMode component when reactStrictMode is true.
By default, reactStrictMode is false. (according to #338)

Checklist:

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 8, 2023

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 99a3602:

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

@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

Merging #1241 (a543597) into main (c04b8f0) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main     #1241   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         5    +1     
  Lines          192       204   +12     
  Branches        38        42    +4     
=========================================
+ Hits           192       204   +12     
Flag Coverage Δ
canary 100.00% <100.00%> (ø)
experimental 100.00% <100.00%> (ø)
latest 100.00% <100.00%> (ø)

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

Files Coverage Δ
src/config.js 100.00% <100.00%> (ø)
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.

Sorry for letting this sit so long. Much appreciated, thanks!

@eps1lon
Copy link
Member

eps1lon commented Jan 30, 2024

Not sure where codecov GH status check is but coverage is at 100%: https://app.codecov.io/github/testing-library/react-testing-library/commit/99a3602cc38c510bcd1546b13056fd70839feee9

@eps1lon eps1lon merged commit 0880eba into testing-library:main Jan 30, 2024
11 checks passed
@eps1lon eps1lon linked an issue Jan 30, 2024 that may be closed by this pull request
@eps1lon
Copy link
Member

eps1lon commented Jan 30, 2024

@all-contributors add @yinm for code

Copy link
Contributor

@eps1lon

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

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.

Add option to enable strict mode render
2 participants