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

Error when using withFormik with enzyme #719

Closed
mtnori opened this issue Jun 30, 2018 · 2 comments
Closed

Error when using withFormik with enzyme #719

mtnori opened this issue Jun 30, 2018 · 2 comments

Comments

@mtnori
Copy link

mtnori commented Jun 30, 2018

Describe the bug
Error when using withFormik with enzyme

To Reproduce

  1. git clone https://github.com/mtnori/formik-enzyme-issue.git
  2. cd formik-enzyme-issue
  3. npm i
  4. npm run test
  5. Error is produced

Expected behavior
successful tests


  • Formik Version: 1.0.0-beta.3
  • React Version: 16.4.1
  • OS: Windows 10
  • Node Version: 8.11.1
  • Package Manager and Version: npm 6.1.0
@JustusFT
Copy link

JustusFT commented Jul 14, 2018

Hi, I also ran into this issue. I get the error Enzyme Internal Error: unknown node with tag 13. It happens whenever I try mount a component that has formik in it. It seems that the current version of enzyme is missing a tag type that formik is using. See their issue enzymejs/enzyme#1509

There's a fix there but it isn't released yet. But you can add it now with enzymejs/enzyme#1513 (comment)

yarn add --dev enzyme-adapter-react-16@npm:enzyme-react-adapter-future

After running this command, your example works fine for me. Hope this helps!

@mtnori
Copy link
Author

mtnori commented Jul 14, 2018

@JustusFT It work fine with your solution, Thanks.

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