You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As Formik evolves, the community is becoming highly involved in creating PRs and executing changes. To support growth and alleviate some pressure on the maintainers, a healthy Unit Testing suite is a worthy goal.
Currently v2 hooks have a lot of callbacks which merely deal with Promises and Dispatch. Testing those callbacks is generally out of scope for this project because those would be integration tests. However, some of those callbacks use logic that I would like to consider for Unit Testing in the future, and I've outlined that logic below.
These are the only pieces I've found on my first pass, but feel free to give it another pass and see if you can find any other important decision-making blocks.
johnrom
changed the title
Additional unit testing for Formik hooks implementation
[v2] Additional unit testing for Formik hooks implementation
May 31, 2019
🚀 Feature request
Current Behavior
As Formik evolves, the community is becoming highly involved in creating PRs and executing changes. To support growth and alleviate some pressure on the maintainers, a healthy Unit Testing suite is a worthy goal.
Currently v2 hooks have a lot of callbacks which merely deal with Promises and Dispatch. Testing those callbacks is generally out of scope for this project because those would be integration tests. However, some of those callbacks use logic that I would like to consider for Unit Testing in the future, and I've outlined that logic below.
These are the only pieces I've found on my first pass, but feel free to give it another pass and see if you can find any other important decision-making blocks.
formik/src/Formik.tsx
Lines 313 to 338 in af86ca9
This is one of the most important functions of Formik, so I recommend creating a test suite for it.
formik/src/Formik.tsx
Lines 496 to 528 in af86ca9
Suggested Solution
Split out the decision-making code blocks into unit testable selectors.
Who does this impact? Who is this for?
Maintainers, Contributors
References
Initial discussion: #1063 (comment)
The text was updated successfully, but these errors were encountered: