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

Support React.Suspense in snapshots. #8180

Merged
merged 2 commits into from
Mar 20, 2019

Conversation

scotthovestadt
Copy link
Contributor

Summary

Resolves #8178

The ReactElement is not aware of the React.Suspense component type, and as a result it causes snapshots to display "UNDEFINED". Fortunately it looks like this serializer is built on top of react-is which already exports a isSuspense so it should hopefully be easy to add this. 😄

Test plan

  • Added unit test. Verified that it failed previously with UNDEFINED as described in the bug report. It now passes.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

Nice!

@codecov-io
Copy link

Codecov Report

Merging #8180 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8180      +/-   ##
==========================================
+ Coverage   62.33%   62.33%   +<.01%     
==========================================
  Files         265      265              
  Lines       10465    10467       +2     
  Branches     2543     2543              
==========================================
+ Hits         6523     6525       +2     
  Misses       3359     3359              
  Partials      583      583
Impacted Files Coverage Δ
packages/pretty-format/src/plugins/ReactElement.ts 86.48% <100%> (+0.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b680db...2a7da08. Read the comment docs.

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReactElement serializer does not support Suspense
5 participants