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

Tooling: use testing-library/react for testing hooks #119

Merged
merged 1 commit into from
Jul 1, 2022

Conversation

mmv08
Copy link
Member

@mmv08 mmv08 commented Jul 1, 2022

@testing-library/react-hooks is going to be deprecated, and all the existing API (most of them) are migrated to core react RTL.

This PR migrates hook testing to the new API. Everything works perfectly except test testing errors since result.current.error is unavailable and renderHook throws. I wrapped such a test in a try/catch instead

@mmv08 mmv08 requested review from katspaugh, usame-algan and iamacook and removed request for katspaugh, usame-algan and iamacook July 1, 2022 11:46
@github-actions
Copy link

github-actions bot commented Jul 1, 2022

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b150cf5
Status: ✅  Deploy successful!
Preview URL: https://cc36c0ce.web-core.pages.dev
Branch Preview URL: https://tooling-use-rtl-for-hooks-te.web-core.pages.dev

View logs

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

🆒

@mmv08 mmv08 merged commit 6102caf into main Jul 1, 2022
@mmv08 mmv08 deleted the tooling/use-rtl-for-hooks-testing branch July 1, 2022 15:59
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.

2 participants