-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
fix(pretty-format): Handle empty string children in React same as react-test-renderer
#14470
fix(pretty-format): Handle empty string children in React same as react-test-renderer
#14470
Conversation
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -21,7 +21,7 @@ const getChildren = (arg: unknown, children: Array<unknown> = []) => { | |||
arg.forEach(item => { | |||
getChildren(item, children); | |||
}); | |||
} else if (arg != null && arg !== false) { | |||
} else if (arg != null && arg !== false && arg !== '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the breaking change
assertPrintedJSX( | ||
React.createElement('Mouse', null, ''), | ||
'<Mouse>\n \n</Mouse>', | ||
); | ||
assertPrintedJSX(React.createElement('Mouse', null, ''), '<Mouse />'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shows the change that will show up in people's snapshots
…act-test-renderer`
6350ca8
to
f0fefae
Compare
I missed this made the tests time out on circle ci... 1a96a5c fixes it |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
I tried to upgrade the entire repo to React 18 (for #14463), and it turns out
react-test-renderer@18
has a change in how it handles empty string children. Which is fine, but aligning is a breaking change in Jest.Test plan
Adjusted the test