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

Add Higher Order component test example #8

Open
nilesh-jadhav opened this issue May 8, 2018 · 1 comment
Open

Add Higher Order component test example #8

nilesh-jadhav opened this issue May 8, 2018 · 1 comment

Comments

@nilesh-jadhav
Copy link

Thanks for the great examples, those are very helpful.
Can you please add an example for HOC.

@ovidiuch
Copy link
Owner

Hi @nilesh-jadhav,

Sorry for neglecting this issue. In the meantime I revamped react-testing-examples.

Could you give an example of what you mean? Note that in the current tests a bunch of HOCs are tested implicitly (eg. Redux's connect or React Router's withRouter).

If you meant testing a custom HOC separately, it might not be the right fit for this project in my opinion. The current examples are testing components from the user's perspective (see philosophy of react-testing-library), so I'd consider a HOC an implementation detail in most cases.

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

No branches or pull requests

2 participants