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

Use react-is in pretty-format #7895

Closed
SimenB opened this issue Feb 14, 2019 · 11 comments · Fixed by #8060
Closed

Use react-is in pretty-format #7895

SimenB opened this issue Feb 14, 2019 · 11 comments · Fixed by #8060

Comments

@SimenB
Copy link
Member

SimenB commented Feb 14, 2019

Right now we have manual $$typeof checks: https://github.com/facebook/jest/blob/af1ab24649798bcf0f7ce6ec5b3cf4ba2a53b5eb/packages/pretty-format/src/plugins/ReactElement.ts#L37-L72

It would be cool to instead use react-is

@mishra-prabhakar
Copy link
Contributor

I would like to work on this.

@SimenB
Copy link
Member Author

SimenB commented Feb 14, 2019

That's awesome @Prabhakar-17! Go for it 🙂

@mishra-prabhakar
Copy link
Contributor

mishra-prabhakar commented Feb 19, 2019

Running yarn install is giving me this error: weak compilation error. Any idea how to resolve this?

@SimenB
Copy link
Member Author

SimenB commented Feb 19, 2019

I'd just remove the dependency in jest-leak-detector and ignore the test warnings surrounding it. I've tried to get it to work on a windows image without luck 🙂

@mishra-prabhakar
Copy link
Contributor

mishra-prabhakar commented Feb 27, 2019

@SimenB How can I test my changes to make sure something else is not broken because of the change. yarn test result looks good, anything specific that needs to be done in this case?

@SimenB
Copy link
Member Author

SimenB commented Feb 27, 2019

If our tests pass, then you're good - we have quite good test coverage on pretty-format. Looking forward to the PR!

@mishra-prabhakar
Copy link
Contributor

There's problem with the @types/react-is package. I have raised an issue here

@SimenB
Copy link
Member Author

SimenB commented Mar 4, 2019

@types/react is at 16.8.6 in this repo (latest) (updated a few days ago)

https://github.com/facebook/jest/blob/5ba35be3ef64090bae5e04f51fd170529fba3d1a/yarn.lock#L1772-L1778

So that should be fixed?

@mackness
Copy link
Contributor

mackness commented Mar 6, 2019

Hi @SimenB, I took a crack at this. Let me know if you think my changes make sense. #8058

Thanks!

@mishra-prabhakar
Copy link
Contributor

@SimenB Yes, it worked. Will submit the PR

SimenB added a commit to mishra-prabhakar/jest that referenced this issue Mar 7, 2019
mishra-prabhakar added a commit to mishra-prabhakar/jest that referenced this issue Mar 7, 2019
@github-actions
Copy link

This issue 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 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants